Class: Vonage::Video::Streams

Inherits:
Namespace
  • Object
show all
Defined in:
lib/vonage/video/streams.rb

Defined Under Namespace

Classes: ListResponse

Instance Method Summary collapse

Instance Method Details

#change_layout(session_id:, **params) ⇒ Response

Change the layout for a list of specified streams.

Parameters:

  • :application_id (optional, String)

    (Required unless already set at Client instantiation or set in ENV)

  • :session_id (required, String)
  • :items (optional, Array<Hash>)

    An array of hashes representing streams and the layout classes for those streams

  • items (Hash)

    a customizable set of options

Returns:

See Also:

  • add docs link


61
62
63
64
65
66
67
68
# File 'lib/vonage/video/streams.rb', line 61

def change_layout(session_id:, **params)
  # TODO camelcase layout_class_list
  # if params[:items]
  #   params[:items] = params[:items].map {|item| camelcase(item)}
  # end

  request('/v2/project/' + @config.application_id + '/session/' + session_id + '/stream', params: params, type: Put)
end

#info(session_id:, stream_id:) ⇒ Response

Get information about a specified stream.

Parameters:

  • :application_id (optional, String)

    (Required unless already set at Client instantiation or set in ENV)

  • :session_id (required, String)
  • :stream_id (required, String)

Returns:

See Also:

  • add docs link


41
42
43
# File 'lib/vonage/video/streams.rb', line 41

def info(session_id:, stream_id:)
  request('/v2/project/' + @config.application_id + '/session/' + session_id + '/stream/' + stream_id)
end

#list(session_id:) ⇒ ListResponse

Get a list of streams for a specified session.

TODO: add auto_advance option

Parameters:

  • :application_id (optional, String)

    (Required unless already set at Client instantiation or set in ENV)

  • :session_id (required, String)

Returns:

See Also:

  • add docs link


25
26
27
# File 'lib/vonage/video/streams.rb', line 25

def list(session_id:)
  request('/v2/project/' + @config.application_id + '/session/' + session_id + '/stream', response_class: ListResponse)
end