Class: M3u8::DateRangeItem

Inherits:
Object
  • Object
show all
Extended by:
M3u8
Includes:
AttributeFormatter, Serializable
Defined in:
lib/m3u8/date_range_item.rb

Overview

DateRangeItem represents a #EXT-X-DATERANGE tag

Constant Summary collapse

INTERSTITIAL_KEYS =
%w[
  X-ASSET-URI X-ASSET-LIST X-RESUME-OFFSET X-PLAYOUT-LIMIT
  X-RESTRICT X-SNAP X-TIMELINE-OCCUPIES X-TIMELINE-STYLE
  X-CONTENT-MAY-VARY
].freeze

Constants included from M3u8

VERSION

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from M3u8

initialize_with_byterange, parse_attributes, parse_float, parse_int, parse_yes_no, to_yes_no

Methods included from AttributeFormatter

#boolean_format, #decimal_format, #quoted_format, #unquoted_format

Methods included from Serializable

#as_json, serialize, #to_h, #to_json

Constructor Details

#initialize(options = {}) ⇒ DateRangeItem

Returns a new instance of DateRangeItem.

Parameters:

  • options (Hash) (defaults to: {})

    attribute key-value pairs



46
47
48
49
50
# File 'lib/m3u8/date_range_item.rb', line 46

def initialize(options = {})
  options.each do |key, value|
    instance_variable_set("@#{key}", value)
  end
end

Instance Attribute Details

#asset_listString, ...

Returns:

  • (String, nil)

    unique date range identifier

  • (String, nil)

    CLASS attribute

  • (String, nil)

    start date (ISO 8601)

  • (String, nil)

    end date (ISO 8601)

  • (Float, nil)

    duration in seconds

  • (Float, nil)

    planned duration in seconds

  • (String, nil)

    SCTE-35 command hex string

  • (String, nil)

    SCTE-35 out hex string

  • (String, nil)

    SCTE-35 in hex string

  • (String, nil)

    CUE attribute

  • (Boolean, nil)

    END-ON-NEXT flag

  • (Hash, nil)

    client-defined X- attributes

  • (String, nil)

    interstitial asset URI

  • (String, nil)

    interstitial asset list URI

  • (Float, nil)

    interstitial resume offset

  • (Float, nil)

    interstitial playout limit

  • (String, nil)

    interstitial restrict value

  • (String, nil)

    interstitial snap value

  • (String, nil)

    interstitial timeline occupies

  • (String, nil)

    interstitial timeline style

  • (String, nil)

    content may vary flag



31
32
33
# File 'lib/m3u8/date_range_item.rb', line 31

def asset_list
  @asset_list
end

#asset_uriString, ...

Returns:

  • (String, nil)

    unique date range identifier

  • (String, nil)

    CLASS attribute

  • (String, nil)

    start date (ISO 8601)

  • (String, nil)

    end date (ISO 8601)

  • (Float, nil)

    duration in seconds

  • (Float, nil)

    planned duration in seconds

  • (String, nil)

    SCTE-35 command hex string

  • (String, nil)

    SCTE-35 out hex string

  • (String, nil)

    SCTE-35 in hex string

  • (String, nil)

    CUE attribute

  • (Boolean, nil)

    END-ON-NEXT flag

  • (Hash, nil)

    client-defined X- attributes

  • (String, nil)

    interstitial asset URI

  • (String, nil)

    interstitial asset list URI

  • (Float, nil)

    interstitial resume offset

  • (Float, nil)

    interstitial playout limit

  • (String, nil)

    interstitial restrict value

  • (String, nil)

    interstitial snap value

  • (String, nil)

    interstitial timeline occupies

  • (String, nil)

    interstitial timeline style

  • (String, nil)

    content may vary flag



31
32
33
# File 'lib/m3u8/date_range_item.rb', line 31

def asset_uri
  @asset_uri
end

#class_nameString, ...

Returns:

  • (String, nil)

    unique date range identifier

  • (String, nil)

    CLASS attribute

  • (String, nil)

    start date (ISO 8601)

  • (String, nil)

    end date (ISO 8601)

  • (Float, nil)

    duration in seconds

  • (Float, nil)

    planned duration in seconds

  • (String, nil)

    SCTE-35 command hex string

  • (String, nil)

    SCTE-35 out hex string

  • (String, nil)

    SCTE-35 in hex string

  • (String, nil)

    CUE attribute

  • (Boolean, nil)

    END-ON-NEXT flag

  • (Hash, nil)

    client-defined X- attributes

  • (String, nil)

    interstitial asset URI

  • (String, nil)

    interstitial asset list URI

  • (Float, nil)

    interstitial resume offset

  • (Float, nil)

    interstitial playout limit

  • (String, nil)

    interstitial restrict value

  • (String, nil)

    interstitial snap value

  • (String, nil)

    interstitial timeline occupies

  • (String, nil)

    interstitial timeline style

  • (String, nil)

    content may vary flag



31
32
33
# File 'lib/m3u8/date_range_item.rb', line 31

def class_name
  @class_name
end

#client_attributesString, ...

Returns:

  • (String, nil)

    unique date range identifier

  • (String, nil)

    CLASS attribute

  • (String, nil)

    start date (ISO 8601)

  • (String, nil)

    end date (ISO 8601)

  • (Float, nil)

    duration in seconds

  • (Float, nil)

    planned duration in seconds

  • (String, nil)

    SCTE-35 command hex string

  • (String, nil)

    SCTE-35 out hex string

  • (String, nil)

    SCTE-35 in hex string

  • (String, nil)

    CUE attribute

  • (Boolean, nil)

    END-ON-NEXT flag

  • (Hash, nil)

    client-defined X- attributes

  • (String, nil)

    interstitial asset URI

  • (String, nil)

    interstitial asset list URI

  • (Float, nil)

    interstitial resume offset

  • (Float, nil)

    interstitial playout limit

  • (String, nil)

    interstitial restrict value

  • (String, nil)

    interstitial snap value

  • (String, nil)

    interstitial timeline occupies

  • (String, nil)

    interstitial timeline style

  • (String, nil)

    content may vary flag



31
32
33
# File 'lib/m3u8/date_range_item.rb', line 31

def client_attributes
  @client_attributes
end

#content_may_varyString, ...

Returns:

  • (String, nil)

    unique date range identifier

  • (String, nil)

    CLASS attribute

  • (String, nil)

    start date (ISO 8601)

  • (String, nil)

    end date (ISO 8601)

  • (Float, nil)

    duration in seconds

  • (Float, nil)

    planned duration in seconds

  • (String, nil)

    SCTE-35 command hex string

  • (String, nil)

    SCTE-35 out hex string

  • (String, nil)

    SCTE-35 in hex string

  • (String, nil)

    CUE attribute

  • (Boolean, nil)

    END-ON-NEXT flag

  • (Hash, nil)

    client-defined X- attributes

  • (String, nil)

    interstitial asset URI

  • (String, nil)

    interstitial asset list URI

  • (Float, nil)

    interstitial resume offset

  • (Float, nil)

    interstitial playout limit

  • (String, nil)

    interstitial restrict value

  • (String, nil)

    interstitial snap value

  • (String, nil)

    interstitial timeline occupies

  • (String, nil)

    interstitial timeline style

  • (String, nil)

    content may vary flag



31
32
33
# File 'lib/m3u8/date_range_item.rb', line 31

def content_may_vary
  @content_may_vary
end

#cueString, ...

Returns:

  • (String, nil)

    unique date range identifier

  • (String, nil)

    CLASS attribute

  • (String, nil)

    start date (ISO 8601)

  • (String, nil)

    end date (ISO 8601)

  • (Float, nil)

    duration in seconds

  • (Float, nil)

    planned duration in seconds

  • (String, nil)

    SCTE-35 command hex string

  • (String, nil)

    SCTE-35 out hex string

  • (String, nil)

    SCTE-35 in hex string

  • (String, nil)

    CUE attribute

  • (Boolean, nil)

    END-ON-NEXT flag

  • (Hash, nil)

    client-defined X- attributes

  • (String, nil)

    interstitial asset URI

  • (String, nil)

    interstitial asset list URI

  • (Float, nil)

    interstitial resume offset

  • (Float, nil)

    interstitial playout limit

  • (String, nil)

    interstitial restrict value

  • (String, nil)

    interstitial snap value

  • (String, nil)

    interstitial timeline occupies

  • (String, nil)

    interstitial timeline style

  • (String, nil)

    content may vary flag



31
32
33
# File 'lib/m3u8/date_range_item.rb', line 31

def cue
  @cue
end

#durationString, ...

Returns:

  • (String, nil)

    unique date range identifier

  • (String, nil)

    CLASS attribute

  • (String, nil)

    start date (ISO 8601)

  • (String, nil)

    end date (ISO 8601)

  • (Float, nil)

    duration in seconds

  • (Float, nil)

    planned duration in seconds

  • (String, nil)

    SCTE-35 command hex string

  • (String, nil)

    SCTE-35 out hex string

  • (String, nil)

    SCTE-35 in hex string

  • (String, nil)

    CUE attribute

  • (Boolean, nil)

    END-ON-NEXT flag

  • (Hash, nil)

    client-defined X- attributes

  • (String, nil)

    interstitial asset URI

  • (String, nil)

    interstitial asset list URI

  • (Float, nil)

    interstitial resume offset

  • (Float, nil)

    interstitial playout limit

  • (String, nil)

    interstitial restrict value

  • (String, nil)

    interstitial snap value

  • (String, nil)

    interstitial timeline occupies

  • (String, nil)

    interstitial timeline style

  • (String, nil)

    content may vary flag



31
32
33
# File 'lib/m3u8/date_range_item.rb', line 31

def duration
  @duration
end

#end_dateString, ...

Returns:

  • (String, nil)

    unique date range identifier

  • (String, nil)

    CLASS attribute

  • (String, nil)

    start date (ISO 8601)

  • (String, nil)

    end date (ISO 8601)

  • (Float, nil)

    duration in seconds

  • (Float, nil)

    planned duration in seconds

  • (String, nil)

    SCTE-35 command hex string

  • (String, nil)

    SCTE-35 out hex string

  • (String, nil)

    SCTE-35 in hex string

  • (String, nil)

    CUE attribute

  • (Boolean, nil)

    END-ON-NEXT flag

  • (Hash, nil)

    client-defined X- attributes

  • (String, nil)

    interstitial asset URI

  • (String, nil)

    interstitial asset list URI

  • (Float, nil)

    interstitial resume offset

  • (Float, nil)

    interstitial playout limit

  • (String, nil)

    interstitial restrict value

  • (String, nil)

    interstitial snap value

  • (String, nil)

    interstitial timeline occupies

  • (String, nil)

    interstitial timeline style

  • (String, nil)

    content may vary flag



31
32
33
# File 'lib/m3u8/date_range_item.rb', line 31

def end_date
  @end_date
end

#end_on_nextString, ...

Returns:

  • (String, nil)

    unique date range identifier

  • (String, nil)

    CLASS attribute

  • (String, nil)

    start date (ISO 8601)

  • (String, nil)

    end date (ISO 8601)

  • (Float, nil)

    duration in seconds

  • (Float, nil)

    planned duration in seconds

  • (String, nil)

    SCTE-35 command hex string

  • (String, nil)

    SCTE-35 out hex string

  • (String, nil)

    SCTE-35 in hex string

  • (String, nil)

    CUE attribute

  • (Boolean, nil)

    END-ON-NEXT flag

  • (Hash, nil)

    client-defined X- attributes

  • (String, nil)

    interstitial asset URI

  • (String, nil)

    interstitial asset list URI

  • (Float, nil)

    interstitial resume offset

  • (Float, nil)

    interstitial playout limit

  • (String, nil)

    interstitial restrict value

  • (String, nil)

    interstitial snap value

  • (String, nil)

    interstitial timeline occupies

  • (String, nil)

    interstitial timeline style

  • (String, nil)

    content may vary flag



31
32
33
# File 'lib/m3u8/date_range_item.rb', line 31

def end_on_next
  @end_on_next
end

#idString, ...

Returns:

  • (String, nil)

    unique date range identifier

  • (String, nil)

    CLASS attribute

  • (String, nil)

    start date (ISO 8601)

  • (String, nil)

    end date (ISO 8601)

  • (Float, nil)

    duration in seconds

  • (Float, nil)

    planned duration in seconds

  • (String, nil)

    SCTE-35 command hex string

  • (String, nil)

    SCTE-35 out hex string

  • (String, nil)

    SCTE-35 in hex string

  • (String, nil)

    CUE attribute

  • (Boolean, nil)

    END-ON-NEXT flag

  • (Hash, nil)

    client-defined X- attributes

  • (String, nil)

    interstitial asset URI

  • (String, nil)

    interstitial asset list URI

  • (Float, nil)

    interstitial resume offset

  • (Float, nil)

    interstitial playout limit

  • (String, nil)

    interstitial restrict value

  • (String, nil)

    interstitial snap value

  • (String, nil)

    interstitial timeline occupies

  • (String, nil)

    interstitial timeline style

  • (String, nil)

    content may vary flag



31
32
33
# File 'lib/m3u8/date_range_item.rb', line 31

def id
  @id
end

#planned_durationString, ...

Returns:

  • (String, nil)

    unique date range identifier

  • (String, nil)

    CLASS attribute

  • (String, nil)

    start date (ISO 8601)

  • (String, nil)

    end date (ISO 8601)

  • (Float, nil)

    duration in seconds

  • (Float, nil)

    planned duration in seconds

  • (String, nil)

    SCTE-35 command hex string

  • (String, nil)

    SCTE-35 out hex string

  • (String, nil)

    SCTE-35 in hex string

  • (String, nil)

    CUE attribute

  • (Boolean, nil)

    END-ON-NEXT flag

  • (Hash, nil)

    client-defined X- attributes

  • (String, nil)

    interstitial asset URI

  • (String, nil)

    interstitial asset list URI

  • (Float, nil)

    interstitial resume offset

  • (Float, nil)

    interstitial playout limit

  • (String, nil)

    interstitial restrict value

  • (String, nil)

    interstitial snap value

  • (String, nil)

    interstitial timeline occupies

  • (String, nil)

    interstitial timeline style

  • (String, nil)

    content may vary flag



31
32
33
# File 'lib/m3u8/date_range_item.rb', line 31

def planned_duration
  @planned_duration
end

#playout_limitString, ...

Returns:

  • (String, nil)

    unique date range identifier

  • (String, nil)

    CLASS attribute

  • (String, nil)

    start date (ISO 8601)

  • (String, nil)

    end date (ISO 8601)

  • (Float, nil)

    duration in seconds

  • (Float, nil)

    planned duration in seconds

  • (String, nil)

    SCTE-35 command hex string

  • (String, nil)

    SCTE-35 out hex string

  • (String, nil)

    SCTE-35 in hex string

  • (String, nil)

    CUE attribute

  • (Boolean, nil)

    END-ON-NEXT flag

  • (Hash, nil)

    client-defined X- attributes

  • (String, nil)

    interstitial asset URI

  • (String, nil)

    interstitial asset list URI

  • (Float, nil)

    interstitial resume offset

  • (Float, nil)

    interstitial playout limit

  • (String, nil)

    interstitial restrict value

  • (String, nil)

    interstitial snap value

  • (String, nil)

    interstitial timeline occupies

  • (String, nil)

    interstitial timeline style

  • (String, nil)

    content may vary flag



31
32
33
# File 'lib/m3u8/date_range_item.rb', line 31

def playout_limit
  @playout_limit
end

#restrictString, ...

Returns:

  • (String, nil)

    unique date range identifier

  • (String, nil)

    CLASS attribute

  • (String, nil)

    start date (ISO 8601)

  • (String, nil)

    end date (ISO 8601)

  • (Float, nil)

    duration in seconds

  • (Float, nil)

    planned duration in seconds

  • (String, nil)

    SCTE-35 command hex string

  • (String, nil)

    SCTE-35 out hex string

  • (String, nil)

    SCTE-35 in hex string

  • (String, nil)

    CUE attribute

  • (Boolean, nil)

    END-ON-NEXT flag

  • (Hash, nil)

    client-defined X- attributes

  • (String, nil)

    interstitial asset URI

  • (String, nil)

    interstitial asset list URI

  • (Float, nil)

    interstitial resume offset

  • (Float, nil)

    interstitial playout limit

  • (String, nil)

    interstitial restrict value

  • (String, nil)

    interstitial snap value

  • (String, nil)

    interstitial timeline occupies

  • (String, nil)

    interstitial timeline style

  • (String, nil)

    content may vary flag



31
32
33
# File 'lib/m3u8/date_range_item.rb', line 31

def restrict
  @restrict
end

#resume_offsetString, ...

Returns:

  • (String, nil)

    unique date range identifier

  • (String, nil)

    CLASS attribute

  • (String, nil)

    start date (ISO 8601)

  • (String, nil)

    end date (ISO 8601)

  • (Float, nil)

    duration in seconds

  • (Float, nil)

    planned duration in seconds

  • (String, nil)

    SCTE-35 command hex string

  • (String, nil)

    SCTE-35 out hex string

  • (String, nil)

    SCTE-35 in hex string

  • (String, nil)

    CUE attribute

  • (Boolean, nil)

    END-ON-NEXT flag

  • (Hash, nil)

    client-defined X- attributes

  • (String, nil)

    interstitial asset URI

  • (String, nil)

    interstitial asset list URI

  • (Float, nil)

    interstitial resume offset

  • (Float, nil)

    interstitial playout limit

  • (String, nil)

    interstitial restrict value

  • (String, nil)

    interstitial snap value

  • (String, nil)

    interstitial timeline occupies

  • (String, nil)

    interstitial timeline style

  • (String, nil)

    content may vary flag



31
32
33
# File 'lib/m3u8/date_range_item.rb', line 31

def resume_offset
  @resume_offset
end

#scte35_cmdString, ...

Returns:

  • (String, nil)

    unique date range identifier

  • (String, nil)

    CLASS attribute

  • (String, nil)

    start date (ISO 8601)

  • (String, nil)

    end date (ISO 8601)

  • (Float, nil)

    duration in seconds

  • (Float, nil)

    planned duration in seconds

  • (String, nil)

    SCTE-35 command hex string

  • (String, nil)

    SCTE-35 out hex string

  • (String, nil)

    SCTE-35 in hex string

  • (String, nil)

    CUE attribute

  • (Boolean, nil)

    END-ON-NEXT flag

  • (Hash, nil)

    client-defined X- attributes

  • (String, nil)

    interstitial asset URI

  • (String, nil)

    interstitial asset list URI

  • (Float, nil)

    interstitial resume offset

  • (Float, nil)

    interstitial playout limit

  • (String, nil)

    interstitial restrict value

  • (String, nil)

    interstitial snap value

  • (String, nil)

    interstitial timeline occupies

  • (String, nil)

    interstitial timeline style

  • (String, nil)

    content may vary flag



31
32
33
# File 'lib/m3u8/date_range_item.rb', line 31

def scte35_cmd
  @scte35_cmd
end

#scte35_inString, ...

Returns:

  • (String, nil)

    unique date range identifier

  • (String, nil)

    CLASS attribute

  • (String, nil)

    start date (ISO 8601)

  • (String, nil)

    end date (ISO 8601)

  • (Float, nil)

    duration in seconds

  • (Float, nil)

    planned duration in seconds

  • (String, nil)

    SCTE-35 command hex string

  • (String, nil)

    SCTE-35 out hex string

  • (String, nil)

    SCTE-35 in hex string

  • (String, nil)

    CUE attribute

  • (Boolean, nil)

    END-ON-NEXT flag

  • (Hash, nil)

    client-defined X- attributes

  • (String, nil)

    interstitial asset URI

  • (String, nil)

    interstitial asset list URI

  • (Float, nil)

    interstitial resume offset

  • (Float, nil)

    interstitial playout limit

  • (String, nil)

    interstitial restrict value

  • (String, nil)

    interstitial snap value

  • (String, nil)

    interstitial timeline occupies

  • (String, nil)

    interstitial timeline style

  • (String, nil)

    content may vary flag



31
32
33
# File 'lib/m3u8/date_range_item.rb', line 31

def scte35_in
  @scte35_in
end

#scte35_outString, ...

Returns:

  • (String, nil)

    unique date range identifier

  • (String, nil)

    CLASS attribute

  • (String, nil)

    start date (ISO 8601)

  • (String, nil)

    end date (ISO 8601)

  • (Float, nil)

    duration in seconds

  • (Float, nil)

    planned duration in seconds

  • (String, nil)

    SCTE-35 command hex string

  • (String, nil)

    SCTE-35 out hex string

  • (String, nil)

    SCTE-35 in hex string

  • (String, nil)

    CUE attribute

  • (Boolean, nil)

    END-ON-NEXT flag

  • (Hash, nil)

    client-defined X- attributes

  • (String, nil)

    interstitial asset URI

  • (String, nil)

    interstitial asset list URI

  • (Float, nil)

    interstitial resume offset

  • (Float, nil)

    interstitial playout limit

  • (String, nil)

    interstitial restrict value

  • (String, nil)

    interstitial snap value

  • (String, nil)

    interstitial timeline occupies

  • (String, nil)

    interstitial timeline style

  • (String, nil)

    content may vary flag



31
32
33
# File 'lib/m3u8/date_range_item.rb', line 31

def scte35_out
  @scte35_out
end

#snapString, ...

Returns:

  • (String, nil)

    unique date range identifier

  • (String, nil)

    CLASS attribute

  • (String, nil)

    start date (ISO 8601)

  • (String, nil)

    end date (ISO 8601)

  • (Float, nil)

    duration in seconds

  • (Float, nil)

    planned duration in seconds

  • (String, nil)

    SCTE-35 command hex string

  • (String, nil)

    SCTE-35 out hex string

  • (String, nil)

    SCTE-35 in hex string

  • (String, nil)

    CUE attribute

  • (Boolean, nil)

    END-ON-NEXT flag

  • (Hash, nil)

    client-defined X- attributes

  • (String, nil)

    interstitial asset URI

  • (String, nil)

    interstitial asset list URI

  • (Float, nil)

    interstitial resume offset

  • (Float, nil)

    interstitial playout limit

  • (String, nil)

    interstitial restrict value

  • (String, nil)

    interstitial snap value

  • (String, nil)

    interstitial timeline occupies

  • (String, nil)

    interstitial timeline style

  • (String, nil)

    content may vary flag



31
32
33
# File 'lib/m3u8/date_range_item.rb', line 31

def snap
  @snap
end

#start_dateString, ...

Returns:

  • (String, nil)

    unique date range identifier

  • (String, nil)

    CLASS attribute

  • (String, nil)

    start date (ISO 8601)

  • (String, nil)

    end date (ISO 8601)

  • (Float, nil)

    duration in seconds

  • (Float, nil)

    planned duration in seconds

  • (String, nil)

    SCTE-35 command hex string

  • (String, nil)

    SCTE-35 out hex string

  • (String, nil)

    SCTE-35 in hex string

  • (String, nil)

    CUE attribute

  • (Boolean, nil)

    END-ON-NEXT flag

  • (Hash, nil)

    client-defined X- attributes

  • (String, nil)

    interstitial asset URI

  • (String, nil)

    interstitial asset list URI

  • (Float, nil)

    interstitial resume offset

  • (Float, nil)

    interstitial playout limit

  • (String, nil)

    interstitial restrict value

  • (String, nil)

    interstitial snap value

  • (String, nil)

    interstitial timeline occupies

  • (String, nil)

    interstitial timeline style

  • (String, nil)

    content may vary flag



31
32
33
# File 'lib/m3u8/date_range_item.rb', line 31

def start_date
  @start_date
end

#timeline_occupiesString, ...

Returns:

  • (String, nil)

    unique date range identifier

  • (String, nil)

    CLASS attribute

  • (String, nil)

    start date (ISO 8601)

  • (String, nil)

    end date (ISO 8601)

  • (Float, nil)

    duration in seconds

  • (Float, nil)

    planned duration in seconds

  • (String, nil)

    SCTE-35 command hex string

  • (String, nil)

    SCTE-35 out hex string

  • (String, nil)

    SCTE-35 in hex string

  • (String, nil)

    CUE attribute

  • (Boolean, nil)

    END-ON-NEXT flag

  • (Hash, nil)

    client-defined X- attributes

  • (String, nil)

    interstitial asset URI

  • (String, nil)

    interstitial asset list URI

  • (Float, nil)

    interstitial resume offset

  • (Float, nil)

    interstitial playout limit

  • (String, nil)

    interstitial restrict value

  • (String, nil)

    interstitial snap value

  • (String, nil)

    interstitial timeline occupies

  • (String, nil)

    interstitial timeline style

  • (String, nil)

    content may vary flag



31
32
33
# File 'lib/m3u8/date_range_item.rb', line 31

def timeline_occupies
  @timeline_occupies
end

#timeline_styleString, ...

Returns:

  • (String, nil)

    unique date range identifier

  • (String, nil)

    CLASS attribute

  • (String, nil)

    start date (ISO 8601)

  • (String, nil)

    end date (ISO 8601)

  • (Float, nil)

    duration in seconds

  • (Float, nil)

    planned duration in seconds

  • (String, nil)

    SCTE-35 command hex string

  • (String, nil)

    SCTE-35 out hex string

  • (String, nil)

    SCTE-35 in hex string

  • (String, nil)

    CUE attribute

  • (Boolean, nil)

    END-ON-NEXT flag

  • (Hash, nil)

    client-defined X- attributes

  • (String, nil)

    interstitial asset URI

  • (String, nil)

    interstitial asset list URI

  • (Float, nil)

    interstitial resume offset

  • (Float, nil)

    interstitial playout limit

  • (String, nil)

    interstitial restrict value

  • (String, nil)

    interstitial snap value

  • (String, nil)

    interstitial timeline occupies

  • (String, nil)

    interstitial timeline style

  • (String, nil)

    content may vary flag



31
32
33
# File 'lib/m3u8/date_range_item.rb', line 31

def timeline_style
  @timeline_style
end

Class Method Details

.parse(text) ⇒ DateRangeItem

Parse an EXT-X-DATERANGE tag.

Parameters:

  • text (String)

    raw tag line

Returns:



55
56
57
58
59
60
61
62
# File 'lib/m3u8/date_range_item.rb', line 55

def self.parse(text)
  attributes = parse_attributes(text)
  options = parse_base_attributes(attributes)
            .merge(parse_interstitials(attributes))
            .merge(client_attributes:
                     parse_client_attributes(attributes))
  DateRangeItem.new(options)
end

Instance Method Details

#scte35_cmd_infoScte35?

Parse SCTE-35 command data.

Returns:



105
106
107
# File 'lib/m3u8/date_range_item.rb', line 105

def scte35_cmd_info
  Scte35.parse(scte35_cmd) unless scte35_cmd.nil?
end

#scte35_in_infoScte35?

Parse SCTE-35 in data.

Returns:



117
118
119
# File 'lib/m3u8/date_range_item.rb', line 117

def scte35_in_info
  Scte35.parse(scte35_in) unless scte35_in.nil?
end

#scte35_out_infoScte35?

Parse SCTE-35 out data.

Returns:



111
112
113
# File 'lib/m3u8/date_range_item.rb', line 111

def scte35_out_info
  Scte35.parse(scte35_out) unless scte35_out.nil?
end

#to_sString

Render as an m3u8 EXT-X-DATERANGE tag.

Returns:

  • (String)


99
100
101
# File 'lib/m3u8/date_range_item.rb', line 99

def to_s
  "#EXT-X-DATERANGE:#{formatted_attributes}"
end