OpenTok ActionScript Library Reference

The OpenTok API reference details the OpenTok ActionScript library and the OpenTok server-side libraries.

For general information on developing with ActionScript, see Using the OpenTok ActionScript library. This topic also includes information on developing using Flex and on building an AIR application.

Note: JavaScript app developers should consult the OpenTok JavaScript API reference.

OpenTok ActionScript library

The OpenTok ActionScript library consists of the following classes.

Class Description
Connection Represents a connection to an OpenTok session.
ConnectionQuality Defines the downstream bandwidth, upstream bandwidth, and latency of the session's connection.
ConnectionEvent Dispatched by the Session object when another user connects or disconnects from a session.
DeviceEvent Dispatched by the DevicePanel object when the user selects a camera or microphone in the device panel.
DeviceManager Lets you select the camera and microphone to use for a publisher stream.
DevicePanel Dispatched by the DevicePanel object when the user selects a device in the device panel.
DevicePanelProperties Defines properties of the properties parameter of the DeviceManager.getDevicePanel() method.
DeviceStatusEvent Dispatched by the DeviceManager object in a response to calling the detectDevices() method.
ExceptionEvent Dispatched by the TB object when the OpenTok API encounters an exception.
Publisher Provides the mechanism through which control of the published stream is accomplished.
PublisherProperties Defines properties of the properties parameter of the Session.publish() method.
Session Represents an OpenTok session and provides access to much of the OpenTok functionality.
SessionConnectEvent Dispatched by the Session object on the connecting page when the session has successfully connected.
SessionConnection Represents a Session object's connection.
SessionConnectProperties Defines the properties parameter of the connect() method of a Session object.
SessionDisconnectEvent Dispatched by the Session object when a session has disconnected.
SignalEvent Dispatched by the Session object when any subscribed session sends a signal.
Stream Provides information about an audio-video stream.
StreamEvent The Session object dispatches StreamEvent events when a session has a stream created or destroyed.
StreamPropertyChangedEvent The Session object dispatches StreamPropertyChangedEvent events when a publisher starts or stops publishing audio or video.
Subscriber Provides the mechanism through which control of a subscribed stream is accomplished.
SubscriberProperties Defines properties of the properties parameter of the Session.subscribe() method.
TB Lets you initialize the OpenTok API, set up error logging, and set up exception event handling.
TBCamera Specifies a camera on the client machine.
TBCapabilities Defines the capabilities property of the Session class.
TBMicrophone Specifies a microphone on the client machine.
VolumeEvent Reports the microphone level for a stream the client has subscribed to.

 

When you develop your ActionScript app, include the OpenTok.swc file as a referenced library. Download the SWC from the Downloads page.

To initialize an OpenTok session, use the TB.initSession() static method. This method returns a Session object. The Session class includes methods for subscribing to streams, publishing streams, and more.

OpenTok server-side libraries

The OpenTok server-side libraries include code for your web server. Use these libraries to obtain OpenTok session IDs and to obtain validation tokens for individual users.

IRC Live Chat

Have a quick question? Chat with other developers.  Join chat

TokBox staff may not be online right now. To reach them during off-hours, visit the forums.