Inherits: : Object
Defined in: : lib/opentok/renders.rb
Overview
A class for working with OpenTok Experience Composer renders. See / Experience Composer.
Instance Method Summary
-
Gets a Render object for the given render ID.
#list(options = {}) ⇒ RenderList
Returns a RenderList, which is an array of Experience Composers renders that are associated with a project.
#start(session_id, options = {}) ⇒ Render
Starts an Experience Composer render for an OpenTok session.
-
Stops an OpenTok Experience Composer render.
Instance Method Details
#find(render_id) ⇒ Render
Gets a Render object for the given render ID.
Parameters:
render_id (String) —
(Required) The render ID.
Returns:
(Render) —
The render object, which includes properties defining the render.
Raises:
-
The request was invalid.
(OpenTokAuthenticationError) —
Authentication failed while stopping a render. Invalid API key.
-
No matching render found (with the specified ID) or it is already stopped
(OpenTokError) —
OpenTok server error.
#list(options = {}) ⇒ RenderList
Returns a RenderList, which is an array of Experience Composers renders that are associated with a project.
Parameters:
options (Hash) (defaults to: {}) —
A hash with keys defining which range of renders to retrieve.
Options Hash (options):
:offset (integer)
— default: Optional —
. The start offset for the list of Experience Composer renders. The default is 0.
:count (integer)
—
Optional. The number of Experience Composer renders to retrieve starting at the offset. The default value is 50 and the maximum is 1000.
Returns:
(RenderList) —
An RenderList object, which is an array of Render objects.
Raises:
- (ArgumentError)
#start(session_id, options = {}) ⇒ Render
Starts an Experience Composer render for an OpenTok session.
Parameters:
session_id (String) —
(Required) The session ID of the OpenTok session that will include the Experience Composer stream.
options (Hash) (defaults to: {}) —
(Required) A hash defining options for the render.
Options Hash (options):
:token (String)
— default: Required —
A valid OpenTok token with a Publisher role and (optionally) connection data to be associated with the output stream.
:url (String)
— default: Required —
A publicly reachable URL controlled by the customer and capable of generating the content to be rendered without user intervention. The minimum length of the URL is 15 characters and the maximum length is 2048 characters.
:max_duration (Integer)
— default: Optional —
The maximum time allowed for the Experience Composer, in seconds. After this time, it is stopped automatically, if it is still running. The maximum value is 36000 (10 hours), the minimum value is 60 (1 minute), and the default value is 7200 (2 hours). When the Experience Composer ends, its stream is unpublished and an event is posted to the callback URL, if configured in the Account Portal.
:resolution (String)
—
The resolution of the Experience Composer, either “640x480” (SD landscape), “480x640” (SD portrait), “1280x720” (HD landscape), “720x1280” (HD portrait), “1920x1080” (FHD landscape), or “1080x1920” (FHD portrait). By default, this resolution is “1280x720” (HD landscape, the default).
:properties (Hash)
— default: Optional —
The initial configuration of Publisher properties for the composed output stream. The properties object contains the key
:name(String) which serves as the name of the composed output stream which is published to the session. The name must have a minimum length of 1 and a maximum length of 200.
Returns:
(Render) —
The render object, which includes properties defining the render, including the render ID.
Raises:
-
The render could not be started. The request was invalid.
(OpenTokAuthenticationError) —
Authentication failed while starting a render. Invalid API key.
(OpenTokError) —
OpenTok server error.
#stop(render_id) ⇒ Render
Stops an OpenTok Experience Composer render.
Parameters:
render_id (String) —
(Required) The render ID.
Returns:
(Render) —
The render object, which includes properties defining the render.
Raises:
-
The request was invalid.
(OpenTokAuthenticationError) —
Authentication failed while stopping a render. Invalid API key.
-
No matching render found (with the specified ID) or it is already stopped
(OpenTokError) —
OpenTok server error.