Class: Livelist::Segment
- Inherits:
-
Object
- Object
- Livelist::Segment
- Defined in:
- lib/livelist/segment.rb
Overview
A Segment to playlist file
Instance Method Summary collapse
-
#append(playlist) ⇒ Object
Append a new segment on playlist file.
-
#hls_append(playlist) ⇒ Object
Append a new segment but removing the previous segment from playlist.
-
#initialize(src, duration) ⇒ Segment
constructor
A new instance of Segment.
Constructor Details
#initialize(src, duration) ⇒ Segment
Returns a new instance of Segment.
8 9 10 11 |
# File 'lib/livelist/segment.rb', line 8 def initialize(src, duration) @src = src @duration = duration end |
Instance Method Details
#append(playlist) ⇒ Object
Append a new segment on playlist file
16 17 18 |
# File 'lib/livelist/segment.rb', line 16 def append(playlist) write(playlist) if File.exist? playlist.path end |
#hls_append(playlist) ⇒ Object
Append a new segment but removing the previous segment from playlist
24 25 26 |
# File 'lib/livelist/segment.rb', line 24 def hls_append(playlist) hls_write(playlist) if File.exist? playlist.path end |