lib/m3u8/playlist.rb in m3u8-0.3.0 vs lib/m3u8/playlist.rb in m3u8-0.3.1
- old
+ new
@@ -36,9 +36,17 @@
def valid?
return false if playlist_size > 0 && segment_size > 0
true
end
+ def duration
+ duration = 0.0
+ items.each do |item|
+ duration += item.duration if item.is_a?(M3u8::SegmentItem)
+ end
+ duration
+ end
+
private
def assign_options(options)
options = {
version: 3,