OpenTok.js reference

The OpenTok.js includes the following classes:

Class Description
ArchiveEvent To see whether an event has a default behavior, check the cancelable property of the event object.
AudioInputDeviceChangedEvent For more information, see this documentation .
AudioLevelUpdatedEvent To see whether an event has a default behavior, check the cancelable property of the event object.
Capabilities All Capabilities properties are undefined until you have connected to a session and the Session object has dispatched the sessionConnected event.
CaptionReceivedEvent To see whether an event has a default behavior, check the cancelable property of the event object.
Connection The Session object has a connection property that is a Connection object. It represents the local client's connection. (A client only has a connection once the client has successfully called the connect() method of the Session object.)
ConnectionEvent The Session object dispatches a connectionCreated event when a client (including your own) connects to a Session. It also dispatches a connectionCreated event for every client in the session when you first connect. (when your local client connects, the Session object also dispatches a sessionConnect
CpuPerformanceChangedEvent To see whether an event has a default behavior, check the cancelable property of the event object.
Error The Error class also defines the Error thrown when the promise returned by one of the following methods is rejected:
Event For example, the Stream object dispatches a streamPropertyChanged event when the stream's properties are updated. You add a callback for an event using the on() method of the Stream object:
EventDispatcher Deprecated — use on() or once() instead.
ExceptionEvent Note that you set up a callback for the exception event by calling the OT.on() method.
MediaStoppedEvent To see whether an event has a default behavior, check the cancelable property of the event object.
MediaStreamAvailableEvent Note that the audio will play through both the custom element and the Publisher or Subscriber widget. The custom elements should be muted to avoid echo.
MuteForcedEvent To see whether an event has a default behavior, check the cancelable property of the event object.
OT Initializes and returns a Publisher object.
Publisher The following code instantiates a session, and publishes an audio-video stream upon connection to the session:
QualityScoreChangedEvent To see whether an event has a default behavior, check the cancelable property of the event object.
Session Deprecated — use on() or once() instead.
SessionConnectEvent In version 2.2, the completionHandler of the Session.connect() method indicates success or failure in connecting to the session.
SessionDisconnectEvent The following code initializes a session and sets up an event listener for when a session is disconnected.
SignalEvent To see whether an event has a default behavior, check the cancelable property of the event object.
Stream When a stream is added to a session, the Session object dispatches a streamCreatedEvent . When a stream is destroyed, the Session object dispatches a streamDestroyed event. The StreamEvent object, which defines these event objects, has a stream property, which is an array of Stream object. For detai
StreamEvent The following code connects to a session and sets up an event listener for when a stream published by another client is created:
StreamPropertyChangedEvent To see whether an event has a default behavior, check the cancelable property of the event object.
Subscriber Deprecated — use on() or once() instead.
VideoDimensionsChangedEvent To see whether an event has a default behavior, check the cancelable property of the event object.
VideoElementCreatedEvent Add a listener for this event only if you have set the insertDefaultUI option to false . If you have not set insertDefaultUI option to false , do not move the video element (or the object element containing the video in Internet Explorer) in the HTML DOM. Doing so causes the Publisher or Subscriber
VideoEnabledChangedEvent If connectivity improves to support video again, the Subscriber object dispatches a videoEnabled event, and the Subscriber resumes receiving video.