lib/m3u8/playlist.rb in m3u8-0.4.0 vs lib/m3u8/playlist.rb in m3u8-0.5.0
- old
+ new
@@ -1,10 +1,11 @@
module M3u8
# Playlist represents an m3u8 playlist, it can be a master playlist or a set
# of media segments
class Playlist
- attr_accessor :items, :version, :cache, :target, :sequence, :type
+ attr_accessor :items, :version, :cache, :target, :sequence, :type,
+ :iframes_only
def initialize(options = {})
assign_options options
self.items = []
end
@@ -53,17 +54,19 @@
def assign_options(options)
options = {
version: 3,
sequence: 0,
cache: true,
- target: 10
+ target: 10,
+ iframes_only: false
}.merge options
self.version = options[:version]
self.sequence = options[:sequence]
self.cache = options[:cache]
self.target = options[:target]
self.type = options[:type]
+ self.iframes_only = options[:iframes_only]
end
def playlist_size
items.select { |item| item.is_a?(PlaylistItem) }.size
end