Class: OpenTok::Render
- Inherits:
-
Object
- Object
- OpenTok::Render
- Defined in:
- lib/opentok/render.rb
Overview
Represents an Experience Composer render of an OpenTok session. See / Experience Composer.
Instance Attribute Summary collapse
-
#created_at ⇒ int
The time the Experience Composer started, expressed in milliseconds since the Unix epoch.
-
#id ⇒ string
The unique ID for the Experience Composer.
-
#project_id ⇒ string
The API key associated with the render.
-
#reason ⇒ string
The reason field is only available when the status is either “stopped” or “failed”.
-
#resolution ⇒ string
The resolution of the Experience Composer (either “640x480”, “480x640”, “1280x720”, “720x1280”, “1920x1080”, or “1080x1920”).
-
#session_id ⇒ string
The session ID of the OpenTok session associated with this render.
-
#status ⇒ string
The status of the Experience Composer.
-
#streamId ⇒ string
The ID of the composed stream being published.
-
#updated_at ⇒ int
The UNIX timestamp when the Experience Composer status was last updated.
-
#url ⇒ string
A publicly reachable URL controlled by the customer and capable of generating the content to be rendered without user intervention.
Instance Method Summary collapse
-
#info ⇒ Object
Gets info about the OpenTok Experience Composer render.
-
#stop ⇒ Object
Stops the OpenTok Experience Composer render.
-
#to_json ⇒ Object
A JSON-encoded string representation of the Experience Composer render.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
69 70 71 72 73 74 75 76 |
# File 'lib/opentok/render.rb', line 69 def method_missing(method, *args, &block) camelized_method = method.to_s.camelize(:lower) if @json.has_key? camelized_method and args.empty? @json[camelized_method] else super method, *args, &block end end |
Instance Attribute Details
#created_at ⇒ int
The time the Experience Composer started, expressed in milliseconds since the Unix epoch.
42 43 44 |
# File 'lib/opentok/render.rb', line 42 def created_at @created_at end |
#id ⇒ string
The unique ID for the Experience Composer.
42 43 44 |
# File 'lib/opentok/render.rb', line 42 def id @id end |
#project_id ⇒ string
The API key associated with the render.
42 43 44 |
# File 'lib/opentok/render.rb', line 42 def project_id @project_id end |
#reason ⇒ string
The reason field is only available when the status is either “stopped” or “failed”. If the status is stopped, the reason field will contain either
"Max Duration Exceeded" or "Stop Requested." If the status is failed, the reason will contain a more specific error message.
42 43 44 |
# File 'lib/opentok/render.rb', line 42 def reason @reason end |
#resolution ⇒ string
The resolution of the Experience Composer (either “640x480”, “480x640”, “1280x720”, “720x1280”, “1920x1080”, or “1080x1920”).
42 43 44 |
# File 'lib/opentok/render.rb', line 42 def resolution @resolution end |
#session_id ⇒ string
The session ID of the OpenTok session associated with this render.
42 43 44 |
# File 'lib/opentok/render.rb', line 42 def session_id @session_id end |
#status ⇒ string
The status of the Experience Composer. Poll frequently to check status updates. This property set to one of the following:
- "starting" — The Vonage Video API platform is in the process of connecting to the remote application at the URL provided. This is the initial state.
- "started" — The Vonage Video API platform has successfully connected to the remote application server, and is publishing the web view to an OpenTok stream.
- "stopped" — The Experience Composer has stopped.
- "failed" — An error occurred and the Experience Composer could not proceed. It may occur at startup if the OpenTok server cannot connect to the remote
application server or republish the stream. It may also occur at any point during the process due to an error in the Vonage Video API platform.
42 43 44 |
# File 'lib/opentok/render.rb', line 42 def status @status end |
#streamId ⇒ string
The ID of the composed stream being published. The streamId is not available when the status is “starting” and may not be available when the status is “failed”.
42 43 44 |
# File 'lib/opentok/render.rb', line 42 def streamId @streamId end |
#updated_at ⇒ int
The UNIX timestamp when the Experience Composer status was last updated.
42 43 44 |
# File 'lib/opentok/render.rb', line 42 def updated_at @updated_at end |
#url ⇒ string
A publicly reachable URL controlled by the customer and capable of generating the content to be rendered without user intervention.
42 43 44 |
# File 'lib/opentok/render.rb', line 42 def url @url end |
Instance Method Details
#info ⇒ Object
Gets info about the OpenTok Experience Composer render.
63 64 65 66 |
# File 'lib/opentok/render.rb', line 63 def info # TODO: validate returned json fits schema @json = @interface.find @json['id'] end |
#stop ⇒ Object
Stops the OpenTok Experience Composer render.
57 58 59 60 |
# File 'lib/opentok/render.rb', line 57 def stop # TODO: validate returned json fits schema @json = @interface.stop @json['id'] end |
#to_json ⇒ Object
A JSON-encoded string representation of the Experience Composer render.
52 53 54 |
# File 'lib/opentok/render.rb', line 52 def to_json @json.to_json end |