Class: ActiveEncode::EngineAdapters::ElasticTranscoderAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/active_encode/engine_adapters/elastic_transcoder_adapter.rb

Instance Method Summary collapse

Instance Method Details

#cancel(encode) ⇒ Object

Can only cancel jobs with status = “Submitted”


27
28
29
30
# File 'lib/active_encode/engine_adapters/elastic_transcoder_adapter.rb', line 27

def cancel(encode)
  response = client.cancel_job(id: encode.id)
  build_encode(get_job_details(encode.id), encode.class) if response.successful?
end

#create(encode) ⇒ Object

TODO: add a stub for an input helper (supplied by an initializer) that transforms encode.input into a zencoder accepted url


5
6
7
8
9
10
11
12
13
14
15
# File 'lib/active_encode/engine_adapters/elastic_transcoder_adapter.rb', line 5

def create(encode)
  job = client.create_job(
    input: { key: encode.input },
    pipeline_id: encode.options[:pipeline_id],
    output_key_prefix: encode.options[:output_key_prefix],
    outputs: encode.options[:outputs],
    user_metadata: encode.options[:user_metadata]
  ).job

  build_encode(get_job_details(job.id), encode.class)
end

#find(id, opts = {}) ⇒ Object


17
18
19
# File 'lib/active_encode/engine_adapters/elastic_transcoder_adapter.rb', line 17

def find(id, opts = {})
  build_encode(get_job_details(id), opts[:cast])
end

#list(*_filters) ⇒ Object

TODO: implement list_jobs_by_pipeline and list_jobs_by_status

Raises:

  • (NotImplementedError)

22
23
24
# File 'lib/active_encode/engine_adapters/elastic_transcoder_adapter.rb', line 22

def list(*_filters)
  raise NotImplementedError
end

#purge(_encode) ⇒ Object

Raises:

  • (NotImplementedError)

32
33
34
# File 'lib/active_encode/engine_adapters/elastic_transcoder_adapter.rb', line 32

def purge(_encode)
  raise NotImplementedError
end

#remove_output(_encode, _output_id) ⇒ Object

Raises:

  • (NotImplementedError)

36
37
38
# File 'lib/active_encode/engine_adapters/elastic_transcoder_adapter.rb', line 36

def remove_output(_encode, _output_id)
  raise NotImplementedError
end