Class: M3u8::PlaylistItem

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

Overview

PlaylistItem represents a set of EXT-X-STREAM-INF or EXT-X-I-FRAME-STREAM-INF attributes

Constant Summary

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(params = {}) ⇒ PlaylistItem

Returns a new instance of PlaylistItem.

Parameters:

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

    attribute key-value pairs



44
45
46
47
48
49
# File 'lib/m3u8/playlist_item.rb', line 44

def initialize(params = {})
  self.iframe = false
  params.each do |key, value|
    instance_variable_set("@#{key}", value)
  end
end

Instance Attribute Details

#allowed_cpcString, ...

Returns:

  • (String, nil)

    program ID

  • (Integer, nil)

    horizontal resolution in pixels

  • (Integer, nil)

    vertical resolution in pixels

  • (String, nil)

    codec string or computed codecs

  • (Integer, nil)

    peak bandwidth in bits/s

  • (String, nil)

    audio codec hint for codecs generation

  • (String, Integer, Float, nil)

    H.264/HEVC/AV1 level

  • (String, nil)

    H.264/HEVC/AV1 profile name

  • (String, nil)

    VIDEO rendition group ID

  • (String, nil)

    AUDIO rendition group ID

  • (String, nil)

    stream URI

  • (Integer, nil)

    average bandwidth in bits/s

  • (String, nil)

    SUBTITLES rendition group ID

  • (String, nil)

    CLOSED-CAPTIONS value or ‘NONE’

  • (Boolean)

    whether this is an I-frame stream

  • (BigDecimal, nil)

    frame rate

  • (String, nil)

    stream name

  • (String, nil)

    HDCP level (TYPE-0, TYPE-1, NONE)

  • (String, nil)

    stable variant ID

  • (String, nil)

    video range (SDR, HLG, PQ)

  • (String, nil)

    allowed CPC value

  • (String, nil)

    content steering pathway ID

  • (String, nil)

    required video layout

  • (String, nil)

    supplemental codecs string

  • (Float, nil)

    stream score



36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def allowed_cpc
  @allowed_cpc
end

#audioString, ...

Returns:

  • (String, nil)

    program ID

  • (Integer, nil)

    horizontal resolution in pixels

  • (Integer, nil)

    vertical resolution in pixels

  • (String, nil)

    codec string or computed codecs

  • (Integer, nil)

    peak bandwidth in bits/s

  • (String, nil)

    audio codec hint for codecs generation

  • (String, Integer, Float, nil)

    H.264/HEVC/AV1 level

  • (String, nil)

    H.264/HEVC/AV1 profile name

  • (String, nil)

    VIDEO rendition group ID

  • (String, nil)

    AUDIO rendition group ID

  • (String, nil)

    stream URI

  • (Integer, nil)

    average bandwidth in bits/s

  • (String, nil)

    SUBTITLES rendition group ID

  • (String, nil)

    CLOSED-CAPTIONS value or ‘NONE’

  • (Boolean)

    whether this is an I-frame stream

  • (BigDecimal, nil)

    frame rate

  • (String, nil)

    stream name

  • (String, nil)

    HDCP level (TYPE-0, TYPE-1, NONE)

  • (String, nil)

    stable variant ID

  • (String, nil)

    video range (SDR, HLG, PQ)

  • (String, nil)

    allowed CPC value

  • (String, nil)

    content steering pathway ID

  • (String, nil)

    required video layout

  • (String, nil)

    supplemental codecs string

  • (Float, nil)

    stream score



36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def audio
  @audio
end

#audio_codecString, ...

Returns:

  • (String, nil)

    program ID

  • (Integer, nil)

    horizontal resolution in pixels

  • (Integer, nil)

    vertical resolution in pixels

  • (String, nil)

    codec string or computed codecs

  • (Integer, nil)

    peak bandwidth in bits/s

  • (String, nil)

    audio codec hint for codecs generation

  • (String, Integer, Float, nil)

    H.264/HEVC/AV1 level

  • (String, nil)

    H.264/HEVC/AV1 profile name

  • (String, nil)

    VIDEO rendition group ID

  • (String, nil)

    AUDIO rendition group ID

  • (String, nil)

    stream URI

  • (Integer, nil)

    average bandwidth in bits/s

  • (String, nil)

    SUBTITLES rendition group ID

  • (String, nil)

    CLOSED-CAPTIONS value or ‘NONE’

  • (Boolean)

    whether this is an I-frame stream

  • (BigDecimal, nil)

    frame rate

  • (String, nil)

    stream name

  • (String, nil)

    HDCP level (TYPE-0, TYPE-1, NONE)

  • (String, nil)

    stable variant ID

  • (String, nil)

    video range (SDR, HLG, PQ)

  • (String, nil)

    allowed CPC value

  • (String, nil)

    content steering pathway ID

  • (String, nil)

    required video layout

  • (String, nil)

    supplemental codecs string

  • (Float, nil)

    stream score



36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def audio_codec
  @audio_codec
end

#average_bandwidthString, ...

Returns:

  • (String, nil)

    program ID

  • (Integer, nil)

    horizontal resolution in pixels

  • (Integer, nil)

    vertical resolution in pixels

  • (String, nil)

    codec string or computed codecs

  • (Integer, nil)

    peak bandwidth in bits/s

  • (String, nil)

    audio codec hint for codecs generation

  • (String, Integer, Float, nil)

    H.264/HEVC/AV1 level

  • (String, nil)

    H.264/HEVC/AV1 profile name

  • (String, nil)

    VIDEO rendition group ID

  • (String, nil)

    AUDIO rendition group ID

  • (String, nil)

    stream URI

  • (Integer, nil)

    average bandwidth in bits/s

  • (String, nil)

    SUBTITLES rendition group ID

  • (String, nil)

    CLOSED-CAPTIONS value or ‘NONE’

  • (Boolean)

    whether this is an I-frame stream

  • (BigDecimal, nil)

    frame rate

  • (String, nil)

    stream name

  • (String, nil)

    HDCP level (TYPE-0, TYPE-1, NONE)

  • (String, nil)

    stable variant ID

  • (String, nil)

    video range (SDR, HLG, PQ)

  • (String, nil)

    allowed CPC value

  • (String, nil)

    content steering pathway ID

  • (String, nil)

    required video layout

  • (String, nil)

    supplemental codecs string

  • (Float, nil)

    stream score



36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def average_bandwidth
  @average_bandwidth
end

#bandwidthString, ...

Returns:

  • (String, nil)

    program ID

  • (Integer, nil)

    horizontal resolution in pixels

  • (Integer, nil)

    vertical resolution in pixels

  • (String, nil)

    codec string or computed codecs

  • (Integer, nil)

    peak bandwidth in bits/s

  • (String, nil)

    audio codec hint for codecs generation

  • (String, Integer, Float, nil)

    H.264/HEVC/AV1 level

  • (String, nil)

    H.264/HEVC/AV1 profile name

  • (String, nil)

    VIDEO rendition group ID

  • (String, nil)

    AUDIO rendition group ID

  • (String, nil)

    stream URI

  • (Integer, nil)

    average bandwidth in bits/s

  • (String, nil)

    SUBTITLES rendition group ID

  • (String, nil)

    CLOSED-CAPTIONS value or ‘NONE’

  • (Boolean)

    whether this is an I-frame stream

  • (BigDecimal, nil)

    frame rate

  • (String, nil)

    stream name

  • (String, nil)

    HDCP level (TYPE-0, TYPE-1, NONE)

  • (String, nil)

    stable variant ID

  • (String, nil)

    video range (SDR, HLG, PQ)

  • (String, nil)

    allowed CPC value

  • (String, nil)

    content steering pathway ID

  • (String, nil)

    required video layout

  • (String, nil)

    supplemental codecs string

  • (Float, nil)

    stream score



36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def bandwidth
  @bandwidth
end

#closed_captionsString, ...

Returns:

  • (String, nil)

    program ID

  • (Integer, nil)

    horizontal resolution in pixels

  • (Integer, nil)

    vertical resolution in pixels

  • (String, nil)

    codec string or computed codecs

  • (Integer, nil)

    peak bandwidth in bits/s

  • (String, nil)

    audio codec hint for codecs generation

  • (String, Integer, Float, nil)

    H.264/HEVC/AV1 level

  • (String, nil)

    H.264/HEVC/AV1 profile name

  • (String, nil)

    VIDEO rendition group ID

  • (String, nil)

    AUDIO rendition group ID

  • (String, nil)

    stream URI

  • (Integer, nil)

    average bandwidth in bits/s

  • (String, nil)

    SUBTITLES rendition group ID

  • (String, nil)

    CLOSED-CAPTIONS value or ‘NONE’

  • (Boolean)

    whether this is an I-frame stream

  • (BigDecimal, nil)

    frame rate

  • (String, nil)

    stream name

  • (String, nil)

    HDCP level (TYPE-0, TYPE-1, NONE)

  • (String, nil)

    stable variant ID

  • (String, nil)

    video range (SDR, HLG, PQ)

  • (String, nil)

    allowed CPC value

  • (String, nil)

    content steering pathway ID

  • (String, nil)

    required video layout

  • (String, nil)

    supplemental codecs string

  • (Float, nil)

    stream score



36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def closed_captions
  @closed_captions
end

#codecsString?

Return or compute the codecs string.

Returns:

  • (String, nil)


36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def codecs
  @codecs
end

#frame_rateString, ...

Returns:

  • (String, nil)

    program ID

  • (Integer, nil)

    horizontal resolution in pixels

  • (Integer, nil)

    vertical resolution in pixels

  • (String, nil)

    codec string or computed codecs

  • (Integer, nil)

    peak bandwidth in bits/s

  • (String, nil)

    audio codec hint for codecs generation

  • (String, Integer, Float, nil)

    H.264/HEVC/AV1 level

  • (String, nil)

    H.264/HEVC/AV1 profile name

  • (String, nil)

    VIDEO rendition group ID

  • (String, nil)

    AUDIO rendition group ID

  • (String, nil)

    stream URI

  • (Integer, nil)

    average bandwidth in bits/s

  • (String, nil)

    SUBTITLES rendition group ID

  • (String, nil)

    CLOSED-CAPTIONS value or ‘NONE’

  • (Boolean)

    whether this is an I-frame stream

  • (BigDecimal, nil)

    frame rate

  • (String, nil)

    stream name

  • (String, nil)

    HDCP level (TYPE-0, TYPE-1, NONE)

  • (String, nil)

    stable variant ID

  • (String, nil)

    video range (SDR, HLG, PQ)

  • (String, nil)

    allowed CPC value

  • (String, nil)

    content steering pathway ID

  • (String, nil)

    required video layout

  • (String, nil)

    supplemental codecs string

  • (Float, nil)

    stream score



36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def frame_rate
  @frame_rate
end

#hdcp_levelString, ...

Returns:

  • (String, nil)

    program ID

  • (Integer, nil)

    horizontal resolution in pixels

  • (Integer, nil)

    vertical resolution in pixels

  • (String, nil)

    codec string or computed codecs

  • (Integer, nil)

    peak bandwidth in bits/s

  • (String, nil)

    audio codec hint for codecs generation

  • (String, Integer, Float, nil)

    H.264/HEVC/AV1 level

  • (String, nil)

    H.264/HEVC/AV1 profile name

  • (String, nil)

    VIDEO rendition group ID

  • (String, nil)

    AUDIO rendition group ID

  • (String, nil)

    stream URI

  • (Integer, nil)

    average bandwidth in bits/s

  • (String, nil)

    SUBTITLES rendition group ID

  • (String, nil)

    CLOSED-CAPTIONS value or ‘NONE’

  • (Boolean)

    whether this is an I-frame stream

  • (BigDecimal, nil)

    frame rate

  • (String, nil)

    stream name

  • (String, nil)

    HDCP level (TYPE-0, TYPE-1, NONE)

  • (String, nil)

    stable variant ID

  • (String, nil)

    video range (SDR, HLG, PQ)

  • (String, nil)

    allowed CPC value

  • (String, nil)

    content steering pathway ID

  • (String, nil)

    required video layout

  • (String, nil)

    supplemental codecs string

  • (Float, nil)

    stream score



36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def hdcp_level
  @hdcp_level
end

#heightString, ...

Returns:

  • (String, nil)

    program ID

  • (Integer, nil)

    horizontal resolution in pixels

  • (Integer, nil)

    vertical resolution in pixels

  • (String, nil)

    codec string or computed codecs

  • (Integer, nil)

    peak bandwidth in bits/s

  • (String, nil)

    audio codec hint for codecs generation

  • (String, Integer, Float, nil)

    H.264/HEVC/AV1 level

  • (String, nil)

    H.264/HEVC/AV1 profile name

  • (String, nil)

    VIDEO rendition group ID

  • (String, nil)

    AUDIO rendition group ID

  • (String, nil)

    stream URI

  • (Integer, nil)

    average bandwidth in bits/s

  • (String, nil)

    SUBTITLES rendition group ID

  • (String, nil)

    CLOSED-CAPTIONS value or ‘NONE’

  • (Boolean)

    whether this is an I-frame stream

  • (BigDecimal, nil)

    frame rate

  • (String, nil)

    stream name

  • (String, nil)

    HDCP level (TYPE-0, TYPE-1, NONE)

  • (String, nil)

    stable variant ID

  • (String, nil)

    video range (SDR, HLG, PQ)

  • (String, nil)

    allowed CPC value

  • (String, nil)

    content steering pathway ID

  • (String, nil)

    required video layout

  • (String, nil)

    supplemental codecs string

  • (Float, nil)

    stream score



36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def height
  @height
end

#iframeString, ...

Returns:

  • (String, nil)

    program ID

  • (Integer, nil)

    horizontal resolution in pixels

  • (Integer, nil)

    vertical resolution in pixels

  • (String, nil)

    codec string or computed codecs

  • (Integer, nil)

    peak bandwidth in bits/s

  • (String, nil)

    audio codec hint for codecs generation

  • (String, Integer, Float, nil)

    H.264/HEVC/AV1 level

  • (String, nil)

    H.264/HEVC/AV1 profile name

  • (String, nil)

    VIDEO rendition group ID

  • (String, nil)

    AUDIO rendition group ID

  • (String, nil)

    stream URI

  • (Integer, nil)

    average bandwidth in bits/s

  • (String, nil)

    SUBTITLES rendition group ID

  • (String, nil)

    CLOSED-CAPTIONS value or ‘NONE’

  • (Boolean)

    whether this is an I-frame stream

  • (BigDecimal, nil)

    frame rate

  • (String, nil)

    stream name

  • (String, nil)

    HDCP level (TYPE-0, TYPE-1, NONE)

  • (String, nil)

    stable variant ID

  • (String, nil)

    video range (SDR, HLG, PQ)

  • (String, nil)

    allowed CPC value

  • (String, nil)

    content steering pathway ID

  • (String, nil)

    required video layout

  • (String, nil)

    supplemental codecs string

  • (Float, nil)

    stream score



36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def iframe
  @iframe
end

#levelString, ...

Returns:

  • (String, nil)

    program ID

  • (Integer, nil)

    horizontal resolution in pixels

  • (Integer, nil)

    vertical resolution in pixels

  • (String, nil)

    codec string or computed codecs

  • (Integer, nil)

    peak bandwidth in bits/s

  • (String, nil)

    audio codec hint for codecs generation

  • (String, Integer, Float, nil)

    H.264/HEVC/AV1 level

  • (String, nil)

    H.264/HEVC/AV1 profile name

  • (String, nil)

    VIDEO rendition group ID

  • (String, nil)

    AUDIO rendition group ID

  • (String, nil)

    stream URI

  • (Integer, nil)

    average bandwidth in bits/s

  • (String, nil)

    SUBTITLES rendition group ID

  • (String, nil)

    CLOSED-CAPTIONS value or ‘NONE’

  • (Boolean)

    whether this is an I-frame stream

  • (BigDecimal, nil)

    frame rate

  • (String, nil)

    stream name

  • (String, nil)

    HDCP level (TYPE-0, TYPE-1, NONE)

  • (String, nil)

    stable variant ID

  • (String, nil)

    video range (SDR, HLG, PQ)

  • (String, nil)

    allowed CPC value

  • (String, nil)

    content steering pathway ID

  • (String, nil)

    required video layout

  • (String, nil)

    supplemental codecs string

  • (Float, nil)

    stream score



36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def level
  @level
end

#nameString, ...

Returns:

  • (String, nil)

    program ID

  • (Integer, nil)

    horizontal resolution in pixels

  • (Integer, nil)

    vertical resolution in pixels

  • (String, nil)

    codec string or computed codecs

  • (Integer, nil)

    peak bandwidth in bits/s

  • (String, nil)

    audio codec hint for codecs generation

  • (String, Integer, Float, nil)

    H.264/HEVC/AV1 level

  • (String, nil)

    H.264/HEVC/AV1 profile name

  • (String, nil)

    VIDEO rendition group ID

  • (String, nil)

    AUDIO rendition group ID

  • (String, nil)

    stream URI

  • (Integer, nil)

    average bandwidth in bits/s

  • (String, nil)

    SUBTITLES rendition group ID

  • (String, nil)

    CLOSED-CAPTIONS value or ‘NONE’

  • (Boolean)

    whether this is an I-frame stream

  • (BigDecimal, nil)

    frame rate

  • (String, nil)

    stream name

  • (String, nil)

    HDCP level (TYPE-0, TYPE-1, NONE)

  • (String, nil)

    stable variant ID

  • (String, nil)

    video range (SDR, HLG, PQ)

  • (String, nil)

    allowed CPC value

  • (String, nil)

    content steering pathway ID

  • (String, nil)

    required video layout

  • (String, nil)

    supplemental codecs string

  • (Float, nil)

    stream score



36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def name
  @name
end

#pathway_idString, ...

Returns:

  • (String, nil)

    program ID

  • (Integer, nil)

    horizontal resolution in pixels

  • (Integer, nil)

    vertical resolution in pixels

  • (String, nil)

    codec string or computed codecs

  • (Integer, nil)

    peak bandwidth in bits/s

  • (String, nil)

    audio codec hint for codecs generation

  • (String, Integer, Float, nil)

    H.264/HEVC/AV1 level

  • (String, nil)

    H.264/HEVC/AV1 profile name

  • (String, nil)

    VIDEO rendition group ID

  • (String, nil)

    AUDIO rendition group ID

  • (String, nil)

    stream URI

  • (Integer, nil)

    average bandwidth in bits/s

  • (String, nil)

    SUBTITLES rendition group ID

  • (String, nil)

    CLOSED-CAPTIONS value or ‘NONE’

  • (Boolean)

    whether this is an I-frame stream

  • (BigDecimal, nil)

    frame rate

  • (String, nil)

    stream name

  • (String, nil)

    HDCP level (TYPE-0, TYPE-1, NONE)

  • (String, nil)

    stable variant ID

  • (String, nil)

    video range (SDR, HLG, PQ)

  • (String, nil)

    allowed CPC value

  • (String, nil)

    content steering pathway ID

  • (String, nil)

    required video layout

  • (String, nil)

    supplemental codecs string

  • (Float, nil)

    stream score



36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def pathway_id
  @pathway_id
end

#profileString, ...

Returns:

  • (String, nil)

    program ID

  • (Integer, nil)

    horizontal resolution in pixels

  • (Integer, nil)

    vertical resolution in pixels

  • (String, nil)

    codec string or computed codecs

  • (Integer, nil)

    peak bandwidth in bits/s

  • (String, nil)

    audio codec hint for codecs generation

  • (String, Integer, Float, nil)

    H.264/HEVC/AV1 level

  • (String, nil)

    H.264/HEVC/AV1 profile name

  • (String, nil)

    VIDEO rendition group ID

  • (String, nil)

    AUDIO rendition group ID

  • (String, nil)

    stream URI

  • (Integer, nil)

    average bandwidth in bits/s

  • (String, nil)

    SUBTITLES rendition group ID

  • (String, nil)

    CLOSED-CAPTIONS value or ‘NONE’

  • (Boolean)

    whether this is an I-frame stream

  • (BigDecimal, nil)

    frame rate

  • (String, nil)

    stream name

  • (String, nil)

    HDCP level (TYPE-0, TYPE-1, NONE)

  • (String, nil)

    stable variant ID

  • (String, nil)

    video range (SDR, HLG, PQ)

  • (String, nil)

    allowed CPC value

  • (String, nil)

    content steering pathway ID

  • (String, nil)

    required video layout

  • (String, nil)

    supplemental codecs string

  • (Float, nil)

    stream score



36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def profile
  @profile
end

#program_idString, ...

Returns:

  • (String, nil)

    program ID

  • (Integer, nil)

    horizontal resolution in pixels

  • (Integer, nil)

    vertical resolution in pixels

  • (String, nil)

    codec string or computed codecs

  • (Integer, nil)

    peak bandwidth in bits/s

  • (String, nil)

    audio codec hint for codecs generation

  • (String, Integer, Float, nil)

    H.264/HEVC/AV1 level

  • (String, nil)

    H.264/HEVC/AV1 profile name

  • (String, nil)

    VIDEO rendition group ID

  • (String, nil)

    AUDIO rendition group ID

  • (String, nil)

    stream URI

  • (Integer, nil)

    average bandwidth in bits/s

  • (String, nil)

    SUBTITLES rendition group ID

  • (String, nil)

    CLOSED-CAPTIONS value or ‘NONE’

  • (Boolean)

    whether this is an I-frame stream

  • (BigDecimal, nil)

    frame rate

  • (String, nil)

    stream name

  • (String, nil)

    HDCP level (TYPE-0, TYPE-1, NONE)

  • (String, nil)

    stable variant ID

  • (String, nil)

    video range (SDR, HLG, PQ)

  • (String, nil)

    allowed CPC value

  • (String, nil)

    content steering pathway ID

  • (String, nil)

    required video layout

  • (String, nil)

    supplemental codecs string

  • (Float, nil)

    stream score



36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def program_id
  @program_id
end

#req_video_layoutString, ...

Returns:

  • (String, nil)

    program ID

  • (Integer, nil)

    horizontal resolution in pixels

  • (Integer, nil)

    vertical resolution in pixels

  • (String, nil)

    codec string or computed codecs

  • (Integer, nil)

    peak bandwidth in bits/s

  • (String, nil)

    audio codec hint for codecs generation

  • (String, Integer, Float, nil)

    H.264/HEVC/AV1 level

  • (String, nil)

    H.264/HEVC/AV1 profile name

  • (String, nil)

    VIDEO rendition group ID

  • (String, nil)

    AUDIO rendition group ID

  • (String, nil)

    stream URI

  • (Integer, nil)

    average bandwidth in bits/s

  • (String, nil)

    SUBTITLES rendition group ID

  • (String, nil)

    CLOSED-CAPTIONS value or ‘NONE’

  • (Boolean)

    whether this is an I-frame stream

  • (BigDecimal, nil)

    frame rate

  • (String, nil)

    stream name

  • (String, nil)

    HDCP level (TYPE-0, TYPE-1, NONE)

  • (String, nil)

    stable variant ID

  • (String, nil)

    video range (SDR, HLG, PQ)

  • (String, nil)

    allowed CPC value

  • (String, nil)

    content steering pathway ID

  • (String, nil)

    required video layout

  • (String, nil)

    supplemental codecs string

  • (Float, nil)

    stream score



36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def req_video_layout
  @req_video_layout
end

#scoreString, ...

Returns:

  • (String, nil)

    program ID

  • (Integer, nil)

    horizontal resolution in pixels

  • (Integer, nil)

    vertical resolution in pixels

  • (String, nil)

    codec string or computed codecs

  • (Integer, nil)

    peak bandwidth in bits/s

  • (String, nil)

    audio codec hint for codecs generation

  • (String, Integer, Float, nil)

    H.264/HEVC/AV1 level

  • (String, nil)

    H.264/HEVC/AV1 profile name

  • (String, nil)

    VIDEO rendition group ID

  • (String, nil)

    AUDIO rendition group ID

  • (String, nil)

    stream URI

  • (Integer, nil)

    average bandwidth in bits/s

  • (String, nil)

    SUBTITLES rendition group ID

  • (String, nil)

    CLOSED-CAPTIONS value or ‘NONE’

  • (Boolean)

    whether this is an I-frame stream

  • (BigDecimal, nil)

    frame rate

  • (String, nil)

    stream name

  • (String, nil)

    HDCP level (TYPE-0, TYPE-1, NONE)

  • (String, nil)

    stable variant ID

  • (String, nil)

    video range (SDR, HLG, PQ)

  • (String, nil)

    allowed CPC value

  • (String, nil)

    content steering pathway ID

  • (String, nil)

    required video layout

  • (String, nil)

    supplemental codecs string

  • (Float, nil)

    stream score



36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def score
  @score
end

#stable_variant_idString, ...

Returns:

  • (String, nil)

    program ID

  • (Integer, nil)

    horizontal resolution in pixels

  • (Integer, nil)

    vertical resolution in pixels

  • (String, nil)

    codec string or computed codecs

  • (Integer, nil)

    peak bandwidth in bits/s

  • (String, nil)

    audio codec hint for codecs generation

  • (String, Integer, Float, nil)

    H.264/HEVC/AV1 level

  • (String, nil)

    H.264/HEVC/AV1 profile name

  • (String, nil)

    VIDEO rendition group ID

  • (String, nil)

    AUDIO rendition group ID

  • (String, nil)

    stream URI

  • (Integer, nil)

    average bandwidth in bits/s

  • (String, nil)

    SUBTITLES rendition group ID

  • (String, nil)

    CLOSED-CAPTIONS value or ‘NONE’

  • (Boolean)

    whether this is an I-frame stream

  • (BigDecimal, nil)

    frame rate

  • (String, nil)

    stream name

  • (String, nil)

    HDCP level (TYPE-0, TYPE-1, NONE)

  • (String, nil)

    stable variant ID

  • (String, nil)

    video range (SDR, HLG, PQ)

  • (String, nil)

    allowed CPC value

  • (String, nil)

    content steering pathway ID

  • (String, nil)

    required video layout

  • (String, nil)

    supplemental codecs string

  • (Float, nil)

    stream score



36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def stable_variant_id
  @stable_variant_id
end

#subtitlesString, ...

Returns:

  • (String, nil)

    program ID

  • (Integer, nil)

    horizontal resolution in pixels

  • (Integer, nil)

    vertical resolution in pixels

  • (String, nil)

    codec string or computed codecs

  • (Integer, nil)

    peak bandwidth in bits/s

  • (String, nil)

    audio codec hint for codecs generation

  • (String, Integer, Float, nil)

    H.264/HEVC/AV1 level

  • (String, nil)

    H.264/HEVC/AV1 profile name

  • (String, nil)

    VIDEO rendition group ID

  • (String, nil)

    AUDIO rendition group ID

  • (String, nil)

    stream URI

  • (Integer, nil)

    average bandwidth in bits/s

  • (String, nil)

    SUBTITLES rendition group ID

  • (String, nil)

    CLOSED-CAPTIONS value or ‘NONE’

  • (Boolean)

    whether this is an I-frame stream

  • (BigDecimal, nil)

    frame rate

  • (String, nil)

    stream name

  • (String, nil)

    HDCP level (TYPE-0, TYPE-1, NONE)

  • (String, nil)

    stable variant ID

  • (String, nil)

    video range (SDR, HLG, PQ)

  • (String, nil)

    allowed CPC value

  • (String, nil)

    content steering pathway ID

  • (String, nil)

    required video layout

  • (String, nil)

    supplemental codecs string

  • (Float, nil)

    stream score



36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def subtitles
  @subtitles
end

#supplemental_codecsString, ...

Returns:

  • (String, nil)

    program ID

  • (Integer, nil)

    horizontal resolution in pixels

  • (Integer, nil)

    vertical resolution in pixels

  • (String, nil)

    codec string or computed codecs

  • (Integer, nil)

    peak bandwidth in bits/s

  • (String, nil)

    audio codec hint for codecs generation

  • (String, Integer, Float, nil)

    H.264/HEVC/AV1 level

  • (String, nil)

    H.264/HEVC/AV1 profile name

  • (String, nil)

    VIDEO rendition group ID

  • (String, nil)

    AUDIO rendition group ID

  • (String, nil)

    stream URI

  • (Integer, nil)

    average bandwidth in bits/s

  • (String, nil)

    SUBTITLES rendition group ID

  • (String, nil)

    CLOSED-CAPTIONS value or ‘NONE’

  • (Boolean)

    whether this is an I-frame stream

  • (BigDecimal, nil)

    frame rate

  • (String, nil)

    stream name

  • (String, nil)

    HDCP level (TYPE-0, TYPE-1, NONE)

  • (String, nil)

    stable variant ID

  • (String, nil)

    video range (SDR, HLG, PQ)

  • (String, nil)

    allowed CPC value

  • (String, nil)

    content steering pathway ID

  • (String, nil)

    required video layout

  • (String, nil)

    supplemental codecs string

  • (Float, nil)

    stream score



36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def supplemental_codecs
  @supplemental_codecs
end

#uriString, ...

Returns:

  • (String, nil)

    program ID

  • (Integer, nil)

    horizontal resolution in pixels

  • (Integer, nil)

    vertical resolution in pixels

  • (String, nil)

    codec string or computed codecs

  • (Integer, nil)

    peak bandwidth in bits/s

  • (String, nil)

    audio codec hint for codecs generation

  • (String, Integer, Float, nil)

    H.264/HEVC/AV1 level

  • (String, nil)

    H.264/HEVC/AV1 profile name

  • (String, nil)

    VIDEO rendition group ID

  • (String, nil)

    AUDIO rendition group ID

  • (String, nil)

    stream URI

  • (Integer, nil)

    average bandwidth in bits/s

  • (String, nil)

    SUBTITLES rendition group ID

  • (String, nil)

    CLOSED-CAPTIONS value or ‘NONE’

  • (Boolean)

    whether this is an I-frame stream

  • (BigDecimal, nil)

    frame rate

  • (String, nil)

    stream name

  • (String, nil)

    HDCP level (TYPE-0, TYPE-1, NONE)

  • (String, nil)

    stable variant ID

  • (String, nil)

    video range (SDR, HLG, PQ)

  • (String, nil)

    allowed CPC value

  • (String, nil)

    content steering pathway ID

  • (String, nil)

    required video layout

  • (String, nil)

    supplemental codecs string

  • (Float, nil)

    stream score



36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def uri
  @uri
end

#videoString, ...

Returns:

  • (String, nil)

    program ID

  • (Integer, nil)

    horizontal resolution in pixels

  • (Integer, nil)

    vertical resolution in pixels

  • (String, nil)

    codec string or computed codecs

  • (Integer, nil)

    peak bandwidth in bits/s

  • (String, nil)

    audio codec hint for codecs generation

  • (String, Integer, Float, nil)

    H.264/HEVC/AV1 level

  • (String, nil)

    H.264/HEVC/AV1 profile name

  • (String, nil)

    VIDEO rendition group ID

  • (String, nil)

    AUDIO rendition group ID

  • (String, nil)

    stream URI

  • (Integer, nil)

    average bandwidth in bits/s

  • (String, nil)

    SUBTITLES rendition group ID

  • (String, nil)

    CLOSED-CAPTIONS value or ‘NONE’

  • (Boolean)

    whether this is an I-frame stream

  • (BigDecimal, nil)

    frame rate

  • (String, nil)

    stream name

  • (String, nil)

    HDCP level (TYPE-0, TYPE-1, NONE)

  • (String, nil)

    stable variant ID

  • (String, nil)

    video range (SDR, HLG, PQ)

  • (String, nil)

    allowed CPC value

  • (String, nil)

    content steering pathway ID

  • (String, nil)

    required video layout

  • (String, nil)

    supplemental codecs string

  • (Float, nil)

    stream score



36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def video
  @video
end

#video_rangeString, ...

Returns:

  • (String, nil)

    program ID

  • (Integer, nil)

    horizontal resolution in pixels

  • (Integer, nil)

    vertical resolution in pixels

  • (String, nil)

    codec string or computed codecs

  • (Integer, nil)

    peak bandwidth in bits/s

  • (String, nil)

    audio codec hint for codecs generation

  • (String, Integer, Float, nil)

    H.264/HEVC/AV1 level

  • (String, nil)

    H.264/HEVC/AV1 profile name

  • (String, nil)

    VIDEO rendition group ID

  • (String, nil)

    AUDIO rendition group ID

  • (String, nil)

    stream URI

  • (Integer, nil)

    average bandwidth in bits/s

  • (String, nil)

    SUBTITLES rendition group ID

  • (String, nil)

    CLOSED-CAPTIONS value or ‘NONE’

  • (Boolean)

    whether this is an I-frame stream

  • (BigDecimal, nil)

    frame rate

  • (String, nil)

    stream name

  • (String, nil)

    HDCP level (TYPE-0, TYPE-1, NONE)

  • (String, nil)

    stable variant ID

  • (String, nil)

    video range (SDR, HLG, PQ)

  • (String, nil)

    allowed CPC value

  • (String, nil)

    content steering pathway ID

  • (String, nil)

    required video layout

  • (String, nil)

    supplemental codecs string

  • (Float, nil)

    stream score



36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def video_range
  @video_range
end

#widthString, ...

Returns:

  • (String, nil)

    program ID

  • (Integer, nil)

    horizontal resolution in pixels

  • (Integer, nil)

    vertical resolution in pixels

  • (String, nil)

    codec string or computed codecs

  • (Integer, nil)

    peak bandwidth in bits/s

  • (String, nil)

    audio codec hint for codecs generation

  • (String, Integer, Float, nil)

    H.264/HEVC/AV1 level

  • (String, nil)

    H.264/HEVC/AV1 profile name

  • (String, nil)

    VIDEO rendition group ID

  • (String, nil)

    AUDIO rendition group ID

  • (String, nil)

    stream URI

  • (Integer, nil)

    average bandwidth in bits/s

  • (String, nil)

    SUBTITLES rendition group ID

  • (String, nil)

    CLOSED-CAPTIONS value or ‘NONE’

  • (Boolean)

    whether this is an I-frame stream

  • (BigDecimal, nil)

    frame rate

  • (String, nil)

    stream name

  • (String, nil)

    HDCP level (TYPE-0, TYPE-1, NONE)

  • (String, nil)

    stable variant ID

  • (String, nil)

    video range (SDR, HLG, PQ)

  • (String, nil)

    allowed CPC value

  • (String, nil)

    content steering pathway ID

  • (String, nil)

    required video layout

  • (String, nil)

    supplemental codecs string

  • (Float, nil)

    stream score



36
37
38
# File 'lib/m3u8/playlist_item.rb', line 36

def width
  @width
end

Class Method Details

.parse(text) ⇒ PlaylistItem

Parse an EXT-X-STREAM-INF or EXT-X-I-FRAME-STREAM-INF tag.

Parameters:

  • text (String)

    raw tag line

Returns:



54
55
56
57
58
# File 'lib/m3u8/playlist_item.rb', line 54

def self.parse(text)
  attributes = parse_attributes(text)
  options = options_from_attributes(attributes)
  PlaylistItem.new(options)
end

Instance Method Details

#resolutionString?

Format the resolution as a WIDTHxHEIGHT string.

Returns:

  • (String, nil)


62
63
64
65
66
# File 'lib/m3u8/playlist_item.rb', line 62

def resolution
  return if width.nil?

  "#{width}x#{height}"
end

#to_sString

Render as an m3u8 tag string.

Returns:

  • (String)


89
90
91
# File 'lib/m3u8/playlist_item.rb', line 89

def to_s
  m3u8_format
end