Class: M3u8::PlaybackStart
- Inherits:
-
Object
- Object
- M3u8::PlaybackStart
- Includes:
- M3u8
- Defined in:
- lib/m3u8/playback_start.rb
Overview
PlaybackStart represents a #EXT-X-START tag and attributes
Constant Summary
Constants included from M3u8
Instance Attribute Summary collapse
-
#precise ⇒ Object
Returns the value of attribute precise.
-
#time_offset ⇒ Object
Returns the value of attribute time_offset.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ PlaybackStart
constructor
A new instance of PlaybackStart.
- #parse(text) ⇒ Object
- #to_s ⇒ Object
Methods included from M3u8
#intialize_with_byterange, #parse_attributes, #parse_float, #parse_yes_no, #to_yes_no
Constructor Details
#initialize(options = {}) ⇒ PlaybackStart
Returns a new instance of PlaybackStart.
8 9 10 11 12 |
# File 'lib/m3u8/playback_start.rb', line 8 def initialize( = {}) .each do |key, value| instance_variable_set("@#{key}", value) end end |
Instance Attribute Details
#precise ⇒ Object
Returns the value of attribute precise.
6 7 8 |
# File 'lib/m3u8/playback_start.rb', line 6 def precise @precise end |
#time_offset ⇒ Object
Returns the value of attribute time_offset.
6 7 8 |
# File 'lib/m3u8/playback_start.rb', line 6 def time_offset @time_offset end |
Instance Method Details
#parse(text) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/m3u8/playback_start.rb', line 14 def parse(text) attributes = parse_attributes(text) @time_offset = attributes['TIME-OFFSET'].to_f precise = attributes['PRECISE'] @precise = parse_yes_no(precise) unless precise.nil? end |
#to_s ⇒ Object
21 22 23 24 25 |
# File 'lib/m3u8/playback_start.rb', line 21 def to_s attributes = ["TIME-OFFSET=#{time_offset}", precise_format].compact.join(',') "#EXT-X-START:#{attributes}" end |