class Bitmovin::Encoding::Manifests::HlsManifest

Attributes

manifest_name[RW]
outputs[RW]

Public Class Methods

new(hash = {}) click to toggle source
Calls superclass method Bitmovin::Resource::new
# File lib/bitmovin/encoding/manifests/hls_manifest.rb, line 8
def initialize(hash = {})
  hsh = ActiveSupport::HashWithIndifferentAccess.new(underscore_hash(hash))
  super(hash)
  @outputs = (hsh[:outputs] || []).map { |output| Bitmovin::Encoding::StreamOutput.new(output) }
  @streams = nil
  @audio_media = nil
end

Public Instance Methods

full_status() click to toggle source
# File lib/bitmovin/encoding/manifests/hls_manifest.rb, line 24
def full_status
  path = File.join("/v1/encoding/manifests/hls/", @id, "status")
  response = Bitmovin.client.get(path)
  hash_to_struct(result(response))
end
progress() click to toggle source
# File lib/bitmovin/encoding/manifests/hls_manifest.rb, line 34
def progress
  full_status.progress
end
start!() click to toggle source
# File lib/bitmovin/encoding/manifests/hls_manifest.rb, line 19
def start!
  path = File.join("/v1/encoding/manifests/hls/", @id, "start")
  Bitmovin.client.post(path)
end
status() click to toggle source
# File lib/bitmovin/encoding/manifests/hls_manifest.rb, line 30
def status
  full_status.status
end

Private Instance Methods

collect_attributes() click to toggle source
# File lib/bitmovin/encoding/manifests/hls_manifest.rb, line 40
def collect_attributes
  val = Hash.new
  [:name, :description, :manifest_name].each do |name|
    json_name = ActiveSupport::Inflector.camelize(name.to_s, false)
    val[json_name] = instance_variable_get("@#{name}")
  end
  val["outputs"] = @outputs.map { |o| o.send(:collect_attributes) }
  val
end