- Inherits:
- Object
- Defined in:
- lib/opentok/broadcasts.rb
Overview
A class for working with OpenTok live streaming broadcasts. See / Live streaming broadcasts.
Instance Method Summary
-
#add_stream(broadcast_id, stream_id, options) ⇒ Object
Adds a stream to currently running broadcast that was started with the streamMode set to “manual”.
-
#all(options = {}) ⇒ BroadcastList
Returns a BroadcastList, which is an array of broadcasts that are completed and in-progress, for your API key.
-
#create(session_id, options = {}) ⇒ Broadcast
Starts a live streaming broadcast of an OpenTok session.
-
#find(broadcast_id) ⇒ Broadcast
Gets a Broadcast object for the given broadcast ID.
-
#layout(broadcast_id, options = {}) ⇒ Object
Dynamically alters the layout an OpenTok broadcast.
-
#remove_stream(broadcast_id, stream_id) ⇒ Object
Removes a stream from a currently running broadcast that was started with the streamMode set to “manual”.
-
#stop(broadcast_id) ⇒ Broadcast
Stops an OpenTok broadcast.
Instance Method Details
#add_stream(broadcast_id, stream_id, options) ⇒ Object
Adds a stream to currently running broadcast that was started with the streamMode set to “manual”. For a description of the feature, see https://tokbox.com/developer/rest/#selecting-broadcast-streams.
You can call the method repeatedly with add_stream set to the same stream ID, to toggle the stream's audio or video in the broadcast. If you set both has_audio and has_video to false, you will get error response.
#all(options = {}) ⇒ BroadcastList
Returns a BroadcastList, which is an array of broadcasts that are completed and in-progress, for your API key.
#create(session_id, options = {}) ⇒ Broadcast
Starts a live streaming broadcast of an OpenTok session.
Clients must be actively connected to the OpenTok session for you to successfully start a broadcast.
This broadcasts the session to an HLS (HTTP live streaming) or to RTMP streams.
Broadcasts#find method.
#find(broadcast_id) ⇒ Broadcast
Gets a Broadcast object for the given broadcast ID.
#layout(broadcast_id, options = {}) ⇒ Object
Dynamically alters the layout an OpenTok broadcast. For more information, see For more information, see Configuring video layout for OpenTok live streaming broadcasts.
#remove_stream(broadcast_id, stream_id) ⇒ Object
Removes a stream from a currently running broadcast that was started with the streamMode set to “manual”. For a description of the feature, see https://tokbox.com/developer/rest/#selecting-broadcast-streams.
#stop(broadcast_id) ⇒ Broadcast
Stops an OpenTok broadcast
Note that broadcasts automatically stop after 120 minute