Class: HLSMediaSegment
- Inherits:
-
Object
- Object
- HLSMediaSegment
- Includes:
- HLSConstants
- Defined in:
- lib/hls_manifest.rb
Constant Summary
Constants included from HLSConstants
HLSConstants::EXTINF, HLSConstants::EXTM3U, HLSConstants::EXT_X_ALLOW_CACHE, HLSConstants::EXT_X_CUE_IN, HLSConstants::EXT_X_CUE_OUT, HLSConstants::EXT_X_DISCONTINUITY, HLSConstants::EXT_X_ENDLIST, HLSConstants::EXT_X_FAXS_CM, HLSConstants::EXT_X_KEY, HLSConstants::EXT_X_KEY_ATTRS, HLSConstants::EXT_X_MEDIA, HLSConstants::EXT_X_MEDIA_SEQUENCE, HLSConstants::EXT_X_PLAYLIST_TYPE, HLSConstants::EXT_X_STREAM_INF, HLSConstants::EXT_X_STREAM_INF_ATTRS, HLSConstants::EXT_X_TARGETDURATION, HLSConstants::EXT_X_VERSION, HLSConstants::FIXNUM_MAX, HLSConstants::SUPPORTED_M3U8_VERSIONS
Instance Attribute Summary collapse
-
#cue_out_duration ⇒ Object
Returns the value of attribute cue_out_duration.
-
#discontinuity ⇒ Object
Returns the value of attribute discontinuity.
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#is_cue_in ⇒ Object
Returns the value of attribute is_cue_in.
-
#is_cue_out ⇒ Object
Returns the value of attribute is_cue_out.
-
#key ⇒ Object
Returns the value of attribute key.
-
#location ⇒ Object
Returns the value of attribute location.
-
#sequence ⇒ Object
Returns the value of attribute sequence.
-
#show_key ⇒ Object
Returns the value of attribute show_key.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize ⇒ HLSMediaSegment
constructor
A new instance of HLSMediaSegment.
Constructor Details
#initialize ⇒ HLSMediaSegment
Returns a new instance of HLSMediaSegment.
62 63 64 65 66 67 68 69 |
# File 'lib/hls_manifest.rb', line 62 def initialize @show_key = true @discontinuity = false @duration = 0 @cue_out_duration = FIXNUM_MAX @is_cue_out = false @is_cue_in = false end |
Instance Attribute Details
#cue_out_duration ⇒ Object
Returns the value of attribute cue_out_duration.
57 58 59 |
# File 'lib/hls_manifest.rb', line 57 def cue_out_duration @cue_out_duration end |
#discontinuity ⇒ Object
Returns the value of attribute discontinuity.
55 56 57 |
# File 'lib/hls_manifest.rb', line 55 def discontinuity @discontinuity end |
#duration ⇒ Object
Returns the value of attribute duration.
52 53 54 |
# File 'lib/hls_manifest.rb', line 52 def duration @duration end |
#is_cue_in ⇒ Object
Returns the value of attribute is_cue_in.
59 60 61 |
# File 'lib/hls_manifest.rb', line 59 def is_cue_in @is_cue_in end |
#is_cue_out ⇒ Object
Returns the value of attribute is_cue_out.
58 59 60 |
# File 'lib/hls_manifest.rb', line 58 def is_cue_out @is_cue_out end |
#key ⇒ Object
Returns the value of attribute key.
50 51 52 |
# File 'lib/hls_manifest.rb', line 50 def key @key end |
#location ⇒ Object
Returns the value of attribute location.
54 55 56 |
# File 'lib/hls_manifest.rb', line 54 def location @location end |
#sequence ⇒ Object
Returns the value of attribute sequence.
60 61 62 |
# File 'lib/hls_manifest.rb', line 60 def sequence @sequence end |
#show_key ⇒ Object
Returns the value of attribute show_key.
51 52 53 |
# File 'lib/hls_manifest.rb', line 51 def show_key @show_key end |
#tags ⇒ Object
Returns the value of attribute tags.
56 57 58 |
# File 'lib/hls_manifest.rb', line 56 def @tags end |
#title ⇒ Object
Returns the value of attribute title.
53 54 55 |
# File 'lib/hls_manifest.rb', line 53 def title @title end |
Instance Method Details
#build ⇒ Object
71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/hls_manifest.rb', line 71 def build return "" unless @location <<-EOT.remove_extra_spaces #{@tags.join("\n")} #{@discontinuity ? EXT_X_DISCONTINUITY : ""} #{@key.build if @key && @show_key} #{EXTINF}:#{@duration},#{@title} #{@location} EOT end |