class M3U8::SegmentItem
- M3U8::SegmentItem
- Reference
- Object
Overview
SegmentItem represents EXTINF attributes with the URI that follows, optionally allowing an EXT-X-BYTERANGE tag to be set.
Included Modules
- M3U8::Concern
Extended Modules
- M3U8::Concern
Defined in:
m3u8/segment_item.crConstructors
-
.new(params : NamedTuple = NamedTuple.new)
options = { duration: 10.991, segment: "test.ts", comment: "anything", byterange: {length: 4500, start: 600}, } SegmentItem.new(options)
- .new(duration : Float64 | Nil = nil, segment : Nil | String = nil, comment : Nil | String = nil, byterange = nil, program_date_time = nil)
Instance Method Summary
- #byterange : ByteRange
-
#byterange=(byterange)
item = SegmentItem.new item.byterange = ByteRange.new(length: 4500, start: 600) item.byterange = {length: 4500, start: 600} item.byterange = "4500@600" item.byterange # => #<M3U8::ByteRange......>
- #comment : String | Nil
- #comment=(comment : String | Nil)
- #duration : Float64 | Nil
- #duration=(duration : Float64 | Nil)
- #program_date_time : TimeItem
-
#program_date_time=(time)
item = SegmentItem.new item.program_date_time = TimeItem.new("2010-02-19T14:54:23Z") item.program_date_time = TimeItem.new(Time.iso8601("2010-02-19T14:54:23.031Z")) item.program_date_time = Time.iso8601("2010-02-19T14:54:23.031Z") item.program_date_time = "2010-02-19T14:54:23.031Z" item.program_date_time # => #<M3U8::TimeItem......>
- #segment : String | Nil
- #segment=(segment : String | Nil)
-
#to_s
options = { duration: 10.991, segment: "test.ts", comment: "anything", byterange: {length: 4500, start: 600}, } SegmentItem.new(options).to_s # => %(#EXTINF:10.991,anything\n#EXT-X-BYTERANGE:4500@600\ntest.ts)
Constructor Detail
options = {
duration: 10.991,
segment: "test.ts",
comment: "anything",
byterange: {length: 4500, start: 600},
}
SegmentItem.new(options)
SegmentItem.new
Instance Method Detail
item = SegmentItem.new
item.byterange = ByteRange.new(length: 4500, start: 600)
item.byterange = {length: 4500, start: 600}
item.byterange = "4500@600"
item.byterange # => #<M3U8::ByteRange......>
item = SegmentItem.new
item.program_date_time = TimeItem.new("2010-02-19T14:54:23Z")
item.program_date_time = TimeItem.new(Time.iso8601("2010-02-19T14:54:23.031Z"))
item.program_date_time = Time.iso8601("2010-02-19T14:54:23.031Z")
item.program_date_time = "2010-02-19T14:54:23.031Z"
item.program_date_time # => #<M3U8::TimeItem......>
options = {
duration: 10.991,
segment: "test.ts",
comment: "anything",
byterange: {length: 4500, start: 600},
}
SegmentItem.new(options).to_s
# => %(#EXTINF:10.991,anything\n#EXT-X-BYTERANGE:4500@600\ntest.ts)