OpenTok API Developer Architecture
See OpenTok Architecture for a conceptual overview of the OpenTok architecture.
OpenTok API Developer Workflows
The OpenTok API gives the developer complete control of how they want to deliver the audio-video session to users. The OpenTok API involves the following workflows:
- Session Creation On the web server, the developer uses the OpenTok server-side libraries to create a session ID.
- Connection Token Creation On the web server, the developer uses the OpenTok server-side libraries to create a secure token.
- Initialize and connect to a session The developer uses the OpenTok API to initialize and connect to a TokBox session.
- Publish to session The developer uses the OpenTok API in the web page to publish an audio-video stream to the session.
- Subscribe to streams The developer uses the OpenTok API to subscribe to a stream.
- Unpublish/unsubscribe a stream The developer uses the OpenTok API to remove a published audio-video stream and unsubscribe from other streams.
- Disconnect from session The developer uses the OpenTok API to disconnect from the session.
- Session Management Based on the requirements of the app, the developer decides when to create sessions for different groups of users.
- Moving from testing to production While developing an application, you can use the OpenTok JavaScript API only and the OpenTok staging servers. When you launch, you use the OpenTok server-side API to generate session IDs and tokens, and you use the OpenTok production servers.
- Archiving The OpenTok archiving feature lets a developer record and play back sessions and streams.
These workflows only provide a basic introduction to the API. The API supports a broader set of functionality than described in these workflows. The OpenTok API includes functionality for viewing group audio-video streams, muting audio, managing connected cameras and microphones, and signaling other browsers. Furthermore, the event mechanism is broader than described in these workflows. The events themselves encapsulate richer information than described in these workflow overviews, helping further inform which actions to take following the receipt of an event.
For developer documentation on the OpenTok JavaScript library, see the OpenTok JavaScript API Reference.
For developer documentation on the OpenTok ActionScript library, see the OpenTok ActionScript API Reference.
For developer documentation on the OpenTok iOS SDK, see the OpenTok iOS SDK Reference.
For developer documentation on the OpenTok server-side libraries, see the OpenTok Server-Side Libraries Reference.
Let's look at the first workflow step: Session creation.
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.