Class: Bitmovin::Encoding::Manifests::DashManifest

Inherits:
Resource
  • Object
show all
Includes:
ChildCollection
Defined in:
lib/bitmovin/encoding/manifests/dash_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, #save!

Methods included from Helpers

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

Constructor Details

#initialize(hash = {}) ⇒ DashManifest

Returns a new instance of DashManifest.



6
7
8
9
10
11
# File 'lib/bitmovin/encoding/manifests/dash_manifest.rb', line 6

def initialize(hash = {})
  hsh = ActiveSupport::HashWithIndifferentAccess.new(underscore_hash(hash))
  super(hash)
  @outputs = (hsh[:outputs] || []).map { |output| Bitmovin::Encoding::StreamOutput.new(output) }
  @periods = nil
end

Instance Attribute Details

#manifest_nameObject

Returns the value of attribute manifest_name.



15
16
17
# File 'lib/bitmovin/encoding/manifests/dash_manifest.rb', line 15

def manifest_name
  @manifest_name
end

#outputsObject

Returns the value of attribute outputs.



15
16
17
# File 'lib/bitmovin/encoding/manifests/dash_manifest.rb', line 15

def outputs
  @outputs
end

Instance Method Details

#full_statusObject



30
31
32
33
34
# File 'lib/bitmovin/encoding/manifests/dash_manifest.rb', line 30

def full_status
  path = File.join("/v1/encoding/manifests/dash/", @id, "status")
  response = Bitmovin.client.get(path)
  hash_to_struct(result(response))
end

#persisted?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/bitmovin/encoding/manifests/dash_manifest.rb', line 17

def persisted?
  !@id.nil?
end

#progressObject



40
41
42
# File 'lib/bitmovin/encoding/manifests/dash_manifest.rb', line 40

def progress
  full_status.progress
end

#reload!Object



21
22
23
# File 'lib/bitmovin/encoding/manifests/dash_manifest.rb', line 21

def reload!
  @periods = nil
end

#start!Object



25
26
27
28
# File 'lib/bitmovin/encoding/manifests/dash_manifest.rb', line 25

def start!
  path = File.join("/v1/encoding/manifests/dash/", @id, "start")
  Bitmovin.client.post(path)
end

#statusObject



36
37
38
# File 'lib/bitmovin/encoding/manifests/dash_manifest.rb', line 36

def status
  full_status.status
end