Sha256: bc237f364cee59636137d536c7ac3ce6740e65da0e085a2af2de521e9ab7990a

Contents?: true

Size: 624 Bytes

Versions: 1

Compression:

Stored size: 624 Bytes

Contents

class M3Uzi
  class Stream < Item

    attr_accessor :path, :bandwidth, :program_id, :codecs, :resolution

    # Unsupported tags: EXT-X-MEDIA, EXT-X-I-FRAME-STREAM-INF
    # Unsupported attributes of EXT-X-STREAM-INF: AUDIO, VIDEO

    def attribute_string
      s = []
      s << "PROGRAM-ID=#{program_id.to_i || 1}"
      s << "BANDWIDTH=#{bandwidth.to_i}"
      s << "CODECS=\"#{codecs}\"" if codecs
      s << "RESOLUTION=#{resolution}" if resolution
      s.join(',')
    end

    def format
      "#EXT-X-STREAM-INF:#{attribute_string}\n#{path}"
    end

    def valid?
      !!(path && bandwidth)
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
m3uzi-0.4.2 lib/m3uzi/stream.rb