Class: ActiveEncode::EngineAdapters::ZencoderAdapter

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

Direct Known Subclasses

ShingoncoderAdapter

Instance Method Summary collapse

Instance Method Details

#cancel(encode) ⇒ Object


18
19
20
21
# File 'lib/active_encode/engine_adapters/zencoder_adapter.rb', line 18

def cancel(encode)
  response = Zencoder::Job.cancel(encode.id)
  build_encode(get_job_details(encode.id), encode.class) if response.success?
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
# File 'lib/active_encode/engine_adapters/zencoder_adapter.rb', line 5

def create(encode)
  response = Zencoder::Job.create(input: encode.input.to_s)
  build_encode(get_job_details(response.body["id"]), encode.class)
end

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


10
11
12
# File 'lib/active_encode/engine_adapters/zencoder_adapter.rb', line 10

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

#list(*_filters) ⇒ Object

Raises:

  • (NotImplementedError)

14
15
16
# File 'lib/active_encode/engine_adapters/zencoder_adapter.rb', line 14

def list(*_filters)
  raise NotImplementedError
end

#purge(_encode) ⇒ Object

Raises:

  • (NotImplementedError)

23
24
25
# File 'lib/active_encode/engine_adapters/zencoder_adapter.rb', line 23

def purge(_encode)
  raise NotImplementedError
end

#remove_output(_encode, _output_id) ⇒ Object

Raises:

  • (NotImplementedError)

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

def remove_output(_encode, _output_id)
  raise NotImplementedError
end