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, start_date = nil, class_name = nil, end_date = nil, duration = nil, planned_duration = nil, scte35_cmd = nil, scte35_out = nil, scte35_in = nil, end_on_next = 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? #

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

[View source]
def client_attributes : ClientAttributeType #

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

[View source]
def duration : Float64? #

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

[View source]
def end_date : String? #

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

[View source]
def end_on_next : Bool? #

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

[View source]
def id : String? #

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

[View source]
def planned_duration : Float64? #

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

[View source]
def scte35_cmd : String? #

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

[View source]
def scte35_in : String? #

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

[View source]
def scte35_out : String? #

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

[View source]
def start_date : String? #

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

[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]