Class: Bitmovin::Encoding::Manifests::HlsManifest

Inherits:
Resource
  • Object
show all
Includes:
ChildCollection
Defined in:
lib/bitmovin/encoding/manifests/hls_manifest.rb

Instance Attribute Summary collapse

Attributes inherited from Resource

#created_at, #description, #id, #modified_at, #name

Instance Method Summary collapse

Methods included from ChildCollection

included

Methods inherited from Resource

#delete!, find, init, #init_instance, #inspect, list, #persisted?, #save!

Methods included from Helpers

#camelize_hash, #hash_to_struct, result, #result, #underscore_hash

Constructor Details

#initialize(hash = {}) ⇒ HlsManifest

Returns a new instance of HlsManifest.



8
9
10
11
12
13
14
# 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

Instance Attribute Details

#manifest_nameObject

Returns the value of attribute manifest_name.



6
7
8
# File 'lib/bitmovin/encoding/manifests/hls_manifest.rb', line 6

def manifest_name
  @manifest_name
end

#outputsObject

Returns the value of attribute outputs.



6
7
8
# File 'lib/bitmovin/encoding/manifests/hls_manifest.rb', line 6

def outputs
  @outputs
end

Instance Method Details

#full_statusObject



24
25
26
27
28
# 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

#progressObject



34
35
36
# File 'lib/bitmovin/encoding/manifests/hls_manifest.rb', line 34

def progress
  full_status.progress
end

#start!Object



19
20
21
22
# 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

#statusObject



30
31
32
# File 'lib/bitmovin/encoding/manifests/hls_manifest.rb', line 30

def status
  full_status.status
end