class M3U8::Codecs

Included Modules

Extended Modules

Defined in:

m3u8/codecs.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(params : NamedTuple = NamedTuple.new) #
options = {audio_codec: "aac-lc"}
Codecs.new(options)
Codecs.new(audio_codec: "aac-lc")

[View source]
def self.new(codecs : Nil | String = nil, audio_codec : Nil | String = nil, level = nil, profile : Nil | String = nil) #
Codecs.new

[View source]

Instance Method Detail

def ==(other : Codecs) #
left = Codecs.new(audio_codec: "aac-lc")
right = Codecs.new(audio_codec: "aac-lc")
left == right # => true

[View source]
def ==(other : String) #
left = Codecs.new(audio_codec: "aac-lc")
right = "aac-lc"
left == right # => true

[View source]
def audio_codec : String | Nil #

[View source]
def audio_codec=(audio_codec : String | Nil) #

[View source]
def codecs : String | Nil #

[View source]
def codecs=(codecs : String | Nil) #

[View source]
def empty? #
codecs = Codecs.new
codecs.empty? # => true
codecs.audio_codec = "aac-lc"
codecs.empty? # => false

[View source]
def level : Float64 | Nil #

[View source]
def level=(level : Float64 | Nil) #

[View source]
def profile : String | Nil #

[View source]
def profile=(profile : String | Nil) #

[View source]
def to_s #
Codecs.new(codecs: "test").to_s                                      # => "test"
Codecs.new(audio_codec: "aac-lc").to_s                               # => "mp4a.40.2"
Codecs.new(profile: "baseline", level: 3.0, audio_codec: "mp3").to_s # => "avc1.66.30,mp4a.40.34"

[View source]