Class: Adhearsion::CallController::Output::Player

Inherits:
AbstractPlayer show all
Defined in:
lib/adhearsion/call_controller/output/player.rb

Instance Attribute Summary

Attributes inherited from AbstractPlayer

#controller

Instance Method Summary collapse

Methods inherited from AbstractPlayer

#initialize, #new_output, #play_ssml, #play_url

Constructor Details

This class inherits a constructor from Adhearsion::CallController::Output::AbstractPlayer

Instance Method Details

#output(content, options = {}) { ... } ⇒ Object

Yields:

  • The output component before executing it

Raises:

  • (PlaybackError)

    if (one of) the given argument(s) could not be played



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/adhearsion/call_controller/output/player.rb', line 12

def output(content, options = {}, &block)
  options.merge! :ssml => content
  component = new_output options
  if block
    controller.execute_component_and_await_completion component, &block
  else
    controller.execute_component_and_await_completion component
  end
rescue Call::Hangup
  raise
rescue Adhearsion::Error, Punchblock::ProtocolError => e
  raise PlaybackError, "Output failed due to #{e.inspect}"
end