class Ari::Playback

Attributes

id[R]
language[R]
media_uri[R]
state[R]
target_uri[R]

Public Class Methods

control(options = {}) click to toggle source

POST /playbacks/%{playbackId}/control

Control object for a playback operation.

Parameters:

playbackId (required) - Playback’s id operation (required) - Operation to perform on the playback.

# File lib/ari/resources/playback.rb, line 69
def self.control(options = {})
  raise ArgumentError.new("Parameter playbackId must be passed in options hash.") unless options[:playbackId]
  raise ArgumentError.new("Parameter operation must be passed in options hash.") unless options[:operation]
  path = '/playbacks/%{playbackId}/control' % options
  response = client(options).post(path, options)
end
get(options = {}) click to toggle source

GET /playbacks/%{playbackId}

Control object for a playback operation.

Parameters:

playbackId (required) - Playback’s id

# File lib/ari/resources/playback.rb, line 27
def self.get(options = {})
  raise ArgumentError.new("Parameter playbackId must be passed in options hash.") unless options[:playbackId]
  path = '/playbacks/%{playbackId}' % options
  response = client(options).get(path, options)
  Playback.new(response.merge(client: options[:client]))
end
stop(options = {}) click to toggle source

DELETE /playbacks/%{playbackId}

Control object for a playback operation.

Parameters:

playbackId (required) - Playback’s id

# File lib/ari/resources/playback.rb, line 47
def self.stop(options = {})
  raise ArgumentError.new("Parameter playbackId must be passed in options hash.") unless options[:playbackId]
  path = '/playbacks/%{playbackId}' % options
  response = client(options).delete(path, options)
rescue Ari::RequestError => e
  raise unless e.code == '404'
end

Public Instance Methods

control(options = {}) click to toggle source
# File lib/ari/resources/playback.rb, line 76
def control(options = {})
  self.class.control(options.merge(playbackId: self.id, client: @client))
end
get(options = {}) click to toggle source
# File lib/ari/resources/playback.rb, line 34
def get(options = {})
  self.class.get(options.merge(playbackId: self.id, client: @client))
end
stop(options = {}) click to toggle source
# File lib/ari/resources/playback.rb, line 55
def stop(options = {})
  self.class.stop(options.merge(playbackId: self.id, client: @client))
end