Class: M3u8::PlaylistItem
- Inherits:
-
Object
- Object
- M3u8::PlaylistItem
- Includes:
- M3u8
- Defined in:
- lib/m3u8/playlist_item.rb
Overview
PlaylistItem represents a set of EXT-X-STREAM-INF or EXT-X-I-FRAME-STREAM-INF attributes
Constant Summary
Constants included from M3u8
Instance Attribute Summary collapse
-
#audio ⇒ Object
Returns the value of attribute audio.
-
#audio_codec ⇒ Object
Returns the value of attribute audio_codec.
-
#average_bandwidth ⇒ Object
Returns the value of attribute average_bandwidth.
-
#bandwidth ⇒ Object
Returns the value of attribute bandwidth.
-
#closed_captions ⇒ Object
Returns the value of attribute closed_captions.
-
#codecs ⇒ Object
Returns the value of attribute codecs.
-
#frame_rate ⇒ Object
Returns the value of attribute frame_rate.
-
#hdcp_level ⇒ Object
Returns the value of attribute hdcp_level.
-
#height ⇒ Object
Returns the value of attribute height.
-
#iframe ⇒ Object
Returns the value of attribute iframe.
-
#level ⇒ Object
Returns the value of attribute level.
-
#name ⇒ Object
Returns the value of attribute name.
-
#profile ⇒ Object
Returns the value of attribute profile.
-
#program_id ⇒ Object
Returns the value of attribute program_id.
-
#subtitles ⇒ Object
Returns the value of attribute subtitles.
-
#uri ⇒ Object
Returns the value of attribute uri.
-
#video ⇒ Object
Returns the value of attribute video.
-
#width ⇒ Object
Returns the value of attribute width.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ PlaylistItem
constructor
A new instance of PlaylistItem.
- #parse(text) ⇒ Object
- #resolution ⇒ Object
- #to_s ⇒ Object
Methods included from M3u8
#intialize_with_byterange, #parse_attributes, #parse_float, #parse_yes_no, #to_yes_no
Constructor Details
#initialize(params = {}) ⇒ PlaylistItem
Returns a new instance of PlaylistItem.
12 13 14 15 16 17 |
# File 'lib/m3u8/playlist_item.rb', line 12 def initialize(params = {}) self.iframe = false params.each do |key, value| instance_variable_set("@#{key}", value) end end |
Instance Attribute Details
#audio ⇒ Object
Returns the value of attribute audio.
7 8 9 |
# File 'lib/m3u8/playlist_item.rb', line 7 def audio @audio end |
#audio_codec ⇒ Object
Returns the value of attribute audio_codec.
7 8 9 |
# File 'lib/m3u8/playlist_item.rb', line 7 def audio_codec @audio_codec end |
#average_bandwidth ⇒ Object
Returns the value of attribute average_bandwidth.
7 8 9 |
# File 'lib/m3u8/playlist_item.rb', line 7 def average_bandwidth @average_bandwidth end |
#bandwidth ⇒ Object
Returns the value of attribute bandwidth.
7 8 9 |
# File 'lib/m3u8/playlist_item.rb', line 7 def bandwidth @bandwidth end |
#closed_captions ⇒ Object
Returns the value of attribute closed_captions.
7 8 9 |
# File 'lib/m3u8/playlist_item.rb', line 7 def @closed_captions end |
#codecs ⇒ Object
Returns the value of attribute codecs.
7 8 9 |
# File 'lib/m3u8/playlist_item.rb', line 7 def codecs @codecs end |
#frame_rate ⇒ Object
Returns the value of attribute frame_rate.
7 8 9 |
# File 'lib/m3u8/playlist_item.rb', line 7 def frame_rate @frame_rate end |
#hdcp_level ⇒ Object
Returns the value of attribute hdcp_level.
7 8 9 |
# File 'lib/m3u8/playlist_item.rb', line 7 def hdcp_level @hdcp_level end |
#height ⇒ Object
Returns the value of attribute height.
7 8 9 |
# File 'lib/m3u8/playlist_item.rb', line 7 def height @height end |
#iframe ⇒ Object
Returns the value of attribute iframe.
7 8 9 |
# File 'lib/m3u8/playlist_item.rb', line 7 def iframe @iframe end |
#level ⇒ Object
Returns the value of attribute level.
7 8 9 |
# File 'lib/m3u8/playlist_item.rb', line 7 def level @level end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/m3u8/playlist_item.rb', line 7 def name @name end |
#profile ⇒ Object
Returns the value of attribute profile.
7 8 9 |
# File 'lib/m3u8/playlist_item.rb', line 7 def profile @profile end |
#program_id ⇒ Object
Returns the value of attribute program_id.
7 8 9 |
# File 'lib/m3u8/playlist_item.rb', line 7 def program_id @program_id end |
#subtitles ⇒ Object
Returns the value of attribute subtitles.
7 8 9 |
# File 'lib/m3u8/playlist_item.rb', line 7 def subtitles @subtitles end |
#uri ⇒ Object
Returns the value of attribute uri.
7 8 9 |
# File 'lib/m3u8/playlist_item.rb', line 7 def uri @uri end |
#video ⇒ Object
Returns the value of attribute video.
7 8 9 |
# File 'lib/m3u8/playlist_item.rb', line 7 def video @video end |
#width ⇒ Object
Returns the value of attribute width.
7 8 9 |
# File 'lib/m3u8/playlist_item.rb', line 7 def width @width end |
Class Method Details
.parse(text) ⇒ Object
19 20 21 22 23 |
# File 'lib/m3u8/playlist_item.rb', line 19 def self.parse(text) item = PlaylistItem.new item.parse(text) item end |
Instance Method Details
#parse(text) ⇒ Object
25 26 27 28 29 |
# File 'lib/m3u8/playlist_item.rb', line 25 def parse(text) attributes = parse_attributes(text) = (attributes) initialize() end |
#resolution ⇒ Object
31 32 33 34 |
# File 'lib/m3u8/playlist_item.rb', line 31 def resolution return if width.nil? "#{width}x#{height}" end |
#to_s ⇒ Object
55 56 57 |
# File 'lib/m3u8/playlist_item.rb', line 55 def to_s m3u8_format end |