Class: HLSPlaylist
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
-
#audio ⇒ Object
Returns the value of attribute audio.
-
#bandwidth ⇒ Object
Returns the value of attribute bandwidth.
-
#codecs ⇒ Object
Returns the value of attribute codecs.
-
#location ⇒ Object
Returns the value of attribute location.
-
#program_id ⇒ Object
Returns the value of attribute program_id.
-
#resolution ⇒ Object
Returns the value of attribute resolution.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#video ⇒ Object
Returns the value of attribute video.
Instance Method Summary collapse
Instance Attribute Details
#audio ⇒ Object
Returns the value of attribute audio.
23 24 25 |
# File 'lib/hls_manifest.rb', line 23 def audio @audio end |
#bandwidth ⇒ Object
Returns the value of attribute bandwidth.
19 20 21 |
# File 'lib/hls_manifest.rb', line 19 def bandwidth @bandwidth end |
#codecs ⇒ Object
Returns the value of attribute codecs.
21 22 23 |
# File 'lib/hls_manifest.rb', line 21 def codecs @codecs end |
#location ⇒ Object
Returns the value of attribute location.
25 26 27 |
# File 'lib/hls_manifest.rb', line 25 def location @location end |
#program_id ⇒ Object
Returns the value of attribute program_id.
20 21 22 |
# File 'lib/hls_manifest.rb', line 20 def program_id @program_id end |
#resolution ⇒ Object
Returns the value of attribute resolution.
22 23 24 |
# File 'lib/hls_manifest.rb', line 22 def resolution @resolution end |
#tags ⇒ Object
Returns the value of attribute tags.
26 27 28 |
# File 'lib/hls_manifest.rb', line 26 def @tags end |
#video ⇒ Object
Returns the value of attribute video.
24 25 26 |
# File 'lib/hls_manifest.rb', line 24 def video @video end |
Instance Method Details
#build ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/hls_manifest.rb', line 28 def build return "" unless @location attributes = [] attributes.push("#{EXT_X_STREAM_INF_ATTRS[:BANDWIDTH]}=#{@bandwidth}") if @bandwidth attributes.push("#{EXT_X_STREAM_INF_ATTRS[:PROGRAM_ID]}=#{@program_id}") if @program_id attributes.push("#{EXT_X_STREAM_INF_ATTRS[:CODECS]}=#{@codecs.join(",")}") if @codecs attributes.push("#{EXT_X_STREAM_INF_ATTRS[:RESOLUTION]}=#{@resolution}") if @resolution attributes.push("#{EXT_X_STREAM_INF_ATTRS[:AUDIO]}=#{@audio}") if @audio attributes.push("#{EXT_X_STREAM_INF_ATTRS[:VIDEO]}=#{@video}") if @video <<-EOT.remove_extra_spaces #{@tags.join("\n")} #{EXT_X_STREAM_INF + ":" + attributes.join(",") unless attributes.empty?} #{@location} EOT end |