class M3U8::DateRangeItem

Overview

DateRangeItem represents a #EXT-X-DATERANGE tag

Included Modules

Extended Modules

Defined in:

m3u8/date_range_item.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(params : NamedTuple = NamedTuple.new) #
options = {
  id:                "test_id",
  start_date:        "2014-03-05T11:15:00Z",
  class_name:        "test_class",
  end_date:          "2014-03-05T11:16:00Z",
  duration:          60.1,
  planned_duration:  59.993,
  scte35_out:        "0xFC002F0000000000FF0",
  scte35_in:         "0xFC002F0000000000FF1",
  scte35_cmd:        "0xFC002F0000000000FF2",
  end_on_next:       true,
  client_attributes: {"X-CUSTOM" => 45.3},
}
DateRangeItem.new(options)

[View source]
def self.new(id : Nil | String = nil, start_date : Nil | String = nil, class_name : Nil | String = nil, end_date : Nil | String = nil, duration : Float64 | Nil = nil, planned_duration : Float64 | Nil = nil, scte35_cmd : Nil | String = nil, scte35_out : Nil | String = nil, scte35_in : Nil | String = nil, end_on_next : Bool | Nil = nil, client_attributes = nil) #
DateRangeItem.new

[View source]

Class Method Detail

def self.parse(text) #
text = %(#EXT-X-DATERANGE:ID="test_id",CLASS="test_class",) \
       %(START-DATE="2014-03-05T11:15:00Z",END-DATE="2014-03-05T11:16:00Z",) \
       %(DURATION=60.1,PLANNED-DURATION=59.993,X-CUSTOM=45.3,) \
       %(SCTE35-CMD=0xFC002F0000000000FF2,SCTE35-OUT=0xFC002F0000000000FF0,) \
       %(SCTE35-IN=0xFC002F0000000000FF1,END-ON-NEXT=YES)
DateRangeItem.parse(text)

[View source]

Instance Method Detail

def class_name : String | Nil #

[View source]
def class_name=(class_name : String | Nil) #

[View source]
def client_attributes : ClientAttributeType #

[View source]
def client_attributes=(client_attributes : ClientAttributeType) #

[View source]
def duration : Float64 | Nil #

[View source]
def duration=(duration : Float64 | Nil) #

[View source]
def end_date : String | Nil #

[View source]
def end_date=(end_date : String | Nil) #

[View source]
def end_on_next : Bool | Nil #

[View source]
def end_on_next=(end_on_next : Bool | Nil) #

[View source]
def id : String | Nil #

[View source]
def id=(id : String | Nil) #

[View source]
def planned_duration : Float64 | Nil #

[View source]
def planned_duration=(planned_duration : Float64 | Nil) #

[View source]
def scte35_cmd : String | Nil #

[View source]
def scte35_cmd=(scte35_cmd : String | Nil) #

[View source]
def scte35_in : String | Nil #

[View source]
def scte35_in=(scte35_in : String | Nil) #

[View source]
def scte35_out : String | Nil #

[View source]
def scte35_out=(scte35_out : String | Nil) #

[View source]
def start_date : String | Nil #

[View source]
def start_date=(start_date : String | Nil) #

[View source]
def to_s #
options = {
  id:                "test_id",
  start_date:        "2014-03-05T11:15:00Z",
  class_name:        "test_class",
  end_date:          "2014-03-05T11:16:00Z",
  duration:          60.1,
  planned_duration:  59.993,
  scte35_out:        "0xFC002F0000000000FF0",
  scte35_in:         "0xFC002F0000000000FF1",
  scte35_cmd:        "0xFC002F0000000000FF2",
  end_on_next:       true,
  client_attributes: {"X-CUSTOM" => 45.3},
}
DateRangeItem.new(options).to_s
# => %(#EXT-X-DATERANGE:ID="test_id",CLASS="test_class",) \
%(START-DATE="2014-03-05T11:15:00Z",END-DATE="2014-03-05T11:16:00Z",) \
%(DURATION=60.1,PLANNED-DURATION=59.993,X-CUSTOM=45.3,) \
%(SCTE35-CMD=0xFC002F0000000000FF2,SCTE35-OUT=0xFC002F0000000000FF0,) \
%(SCTE35-IN=0xFC002F0000000000FF1,END-ON-NEXT=YES)

[View source]