class M3U8::MapItem

Overview

MapItem represents a EXT-X-MAP tag which specifies how to obtain the Media Initialization Section

Included Modules

Extended Modules

Defined in:

m3u8/map_item.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(params : NamedTuple = NamedTuple.new) #
options = {
  uri:       "frelo/prog_index.m3u8",
  byterange: {
    length: 4500,
    start:  600,
  },
}
MapItem.new(options)

options = {
  uri:       "frelo/prog_index.m3u8",
  byterange: ByteRange.new(length: 4500, start: 600),
}
MapItem.new(options)

options = {
  uri:       "frelo/prog_index.m3u8",
  byterange: "4500@600",
}
MapItem.new(options)

[View source]
def self.new(uri : String, byterange = nil) #
uri = "frelo/prog_index.m3u8"
byterange = "4500@600"
MapItem.new(uri)
MapItem.new(uri, byterange)
MapItem.new(uri: uri)
MapItem.new(uri: uri, byterange: byterange)

[View source]

Class Method Detail

def self.parse(text) #
text = %(#EXT-X-MAP:URI="frelo/prog_index.m3u8",BYTERANGE="4500@600")
MapItem.parse(text)
# => #<M3U8::MapItem......>

[View source]

Instance Method Detail

def byterange : ByteRange #

[View source]
def byterange=(byterange : ByteRange) #

[View source]
def to_s #
options = {
  uri:       "frelo/prog_index.m3u8",
  byterange: "4500@600",
}
MapItem.new(options).to_s
# => %(#EXT-X-MAP:URI="frelo/prog_index.m3u8",BYTERANGE="4500@600")

[View source]
def uri : String #

[View source]
def uri=(uri : String) #

[View source]