Class: M3u8::Scte35SpliceInsert

Inherits:
Object
  • Object
show all
Defined in:
lib/m3u8/scte35_splice_insert.rb

Overview

Represents a splice_insert SCTE-35 command (type 0x05)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Scte35SpliceInsert

Returns a new instance of Scte35SpliceInsert.



11
12
13
14
15
# File 'lib/m3u8/scte35_splice_insert.rb', line 11

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

Instance Attribute Details

#avail_numObject (readonly)

Returns the value of attribute avail_num.



6
7
8
# File 'lib/m3u8/scte35_splice_insert.rb', line 6

def avail_num
  @avail_num
end

#avails_expectedObject (readonly)

Returns the value of attribute avails_expected.



6
7
8
# File 'lib/m3u8/scte35_splice_insert.rb', line 6

def avails_expected
  @avails_expected
end

#break_auto_returnObject (readonly)

Returns the value of attribute break_auto_return.



6
7
8
# File 'lib/m3u8/scte35_splice_insert.rb', line 6

def break_auto_return
  @break_auto_return
end

#break_durationObject (readonly)

Returns the value of attribute break_duration.



6
7
8
# File 'lib/m3u8/scte35_splice_insert.rb', line 6

def break_duration
  @break_duration
end

#out_of_network_indicatorObject (readonly)

Returns the value of attribute out_of_network_indicator.



6
7
8
# File 'lib/m3u8/scte35_splice_insert.rb', line 6

def out_of_network_indicator
  @out_of_network_indicator
end

#pts_timeObject (readonly)

Returns the value of attribute pts_time.



6
7
8
# File 'lib/m3u8/scte35_splice_insert.rb', line 6

def pts_time
  @pts_time
end

#splice_event_cancel_indicatorObject (readonly)

Returns the value of attribute splice_event_cancel_indicator.



6
7
8
# File 'lib/m3u8/scte35_splice_insert.rb', line 6

def splice_event_cancel_indicator
  @splice_event_cancel_indicator
end

#splice_event_idObject (readonly)

Returns the value of attribute splice_event_id.



6
7
8
# File 'lib/m3u8/scte35_splice_insert.rb', line 6

def splice_event_id
  @splice_event_id
end

#unique_program_idObject (readonly)

Returns the value of attribute unique_program_id.



6
7
8
# File 'lib/m3u8/scte35_splice_insert.rb', line 6

def unique_program_id
  @unique_program_id
end

Class Method Details

.parse_from(reader, _length) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/m3u8/scte35_splice_insert.rb', line 17

def self.parse_from(reader, _length)
  attrs = { splice_event_id: reader.read_bits(32) }
  attrs[:splice_event_cancel_indicator] = reader.read_flag
  reader.skip_bits(7) # reserved
  return new(**attrs) if attrs[:splice_event_cancel_indicator]

  parse_splice_detail(reader, attrs)
end