Release Notes for the OpenTok.js library

Welcome to version 2.4 of the OpenTok.js library.

If you have any questions, concerns, feedback, please let us know on our forums.

New features
Known issues
Fixed issues
More information
How to report bugs

For details on the OpenTok.js API, see the OpenTok.js library reference.


Versioning and SRC path changes — The OpenTok.js library version numbering is changing with version 2.4. You should now load the OpenTok library by referencing the major version only in the script tag:

<script src="//"></script>

Also note that the path to the library no longer includes "webrtc/". The OpenTok.js library now only supports WebRTC audio-video streams. OpenTok has discontinued support for version 1.0, which used the Adobe Flash plug-in (not WebRTC).

Because of this versioning change, an old SRC URL pointing to v2.2 of the OpenTok.js library ("//") will redirect to the latest version of v2. This redirect will only apply to a URL pointing to "webrtc/v2.2" (the version before the versioning change) and not to any upcoming minor releases. If you need to load v2.2, set the SRC URL to "//".

For more information, see OpenTok version numbers.

OpenTok Plugin for Internet Explorer — The OpenTok Plugin for Internet Explorer enables OpenTok sessions in Internet Explorer. The plugin now works in Internet Explorer 8 - 11 (not supported in 64-bit mode). For information on testing your app with the OpenTok Plugin for Internet Explorer, see this article.

Migrating from older versions — If you are moving code from version 2.0, see Migrating from OpenTok.js 2.0. If you are moving code from version 1.0, see Migrating from version 1.0 of the OpenTok JavaScript library.

New Features on January 8, 2015 — OpenTok.js 2.4.0

Versioning and SRC path changes — See the note in the Announcements section.

Screen-sharing support — You can now share your screen as the video source for a publisher in Chrome and Firefox. Other clients (using OpenTok.js or the OpenTok Android or iOS SDKs version 2.4) can subscribe to the screen-sharing stream, just as they would subscribe to a stream that uses a camera as the video source. For more information, see Screen sharing — JavaScript and the following sections of the OpenTok.js reference:

Control of cropping and letter-boxing of videos — You can now specify whether videos will be cropped or letter-boxed when the aspect ratio of the video does not match the aspect ratio of the DOM element. Set the fitMode property when you initialize the Publisher or Subscriber object. See the documentation for OT.initPublisher() and Session.subscribe().

Disabling the audio-fallback feature — The audio-fallback feature, added in OpenTok.js 2.2.9, is available in sessions that use the the OpenTok Media Router. With this feature, a subscriber to a stream will drop the stream's video (switching to audio-only mode) due to poor stream quality (perhaps because of network conditions). You can disable this feature by setting the audioFallbackEnabled property of the properties parameter to false when you call the OT.initPublisher() method to create a publisher. (Subscriber's to the published stream will not have the video stream drop out due to poor stream quality.)

Features added in previous versions

Show details.


The OpenTok.js library is currently supported in:

  • Google Chrome (latest release version)
  • Google Chrome for Android (latest release version)
  • Firefox (latest release version)
  • Firefox for Android (latest release version)
  • Internet Explorer 8 - 11 with the OpenTok Plugin for Internet Explorer (not supported in 64-bit mode)
  • Opera (latest release version)

The OpenTok.js library uses port 443. Port 443 must be open on the client network.

Known issues

The following are known issues for this version of the OpenTok on WebRTC JavaScript library.

Issues subscribing to screen-sharing streams You cannot subscribe to screen-sharing streams in OpenTok.js version 2.2. To publish or subscribe to screen-sharing streams, upgrade to version 2.4.

Repositioning and resizing Publisher and Subscriber elements. Do not reparent a a Publisher or Subscriber in the HTML DOM. You can reposition these elements by changing style properties. See this information on resizing and repositioning videos.

One Publisher in the OpenTok Plugin for Internet Explorer. You can only add one Publisher (within all browser windows and tabs). The plugin supports adding no more than two Subscribers to the page.

Cannot hide a Publisher or Subscriber in the OpenTok Plugin for Internet Explorer. Attempting to hide the a Publisher or Subscriber (by setting style.display to "none" or visibility to "hidden") causes Internet Explorer to crash.

Issue subscribing to your own stream in Internet Explorer. In Internet Explorer, you cannot subscribe to a stream published by your own client.

Issue subscribing repeatedly to a stream in Internet Explorer 8. In Internet Explorer 8, resubscribing multiple times to the same stream can cause the Publisher of the stream to stop streaming.

The OpenTok Plugin does not support 64-bit mode in Internet Explorer. The plugin works in the 32-bit mode only.

Sessions disconnect unexpectedly in Internet Explorer 8 and 9. We have seen this issue occur occasionally if there are other clients publishing streams in the session when the client using Internet Explorer connects. If you experience this problem, please let us know at the TokBox Plugin forum. (Please provide details, including the version of Windows, the version of Internet Explorer, the version of the Plugin, the URL of the app, and what was led up to the session disconnecting. You can get the version of the plugin by entering TBPlugin.version() in the console.)

OT.getDevices() supported in Chrome only. This method does not work in other browsers.

WebRTC is a peer-to-peer protocol, and it is possible that connections will fail to connect. The most common cause for failure is a firewall that the protocol cannot traverse. When OpenTok detects this failure, the TB object dispatches an exception event object, with the code property set to 1013.

You cannot publish using WebRTC on a page loaded from a file:// URL. You need to load the page from an http:// URL. For example, you can test a file from http://localhost if you have a web server set up on your local machine.

Fixed in OpenTok.js 2.4

Fixed in 2.4.1:

A publisher or subscriber element is not resized when the container element resizes (programmatically or due CSS changes). We have fixed this issue.

The audio-only background image is not displayed in voice-only publishers and subscribers. We have fixed this issue.

Unable to publish on an HTTP page using the OpenTok Plugin for Internet Explorer. We have fixed this issue.

CSS layout issues in the installer for the OpenTok Plugin for Internet Explorer. We have fixed these issues.

Fixed in 2.4.0:

Non-responsive dialog boxes in the OpenTok Plugin for Internet Explorer. The installation and update dialog boxes are now responsive, resizing appropriately based on the browser window's dimensions.

Unsupported methods in the OpenTok Plugin for Internet Explorer. The following methods now work: Subscriber.setAudioVolume() and Subscriber.getAudioVolume(). Also, the audioLevelUpdated event is now dispatched by Subscriber and Publisher objects in the OpenTok Plugin for Internet Explorer.

Cannot reconnect to a session without reloading the page. We have fixed this issue.

Audio level meter displayed when it should not be. The publisher and subscriber audio meter was being used even if the client is using video (not audio-only). We have fixed this issue.

Uncaught error when calling Subscriber.subscribeToAudio(). The uncaught error was "Uncaught TypeError: Cannot read property 'id' of null." We have fixed this issue.

Multiple console warnings for "Style.setAll::Invalid style property passed videoDisabledIndicatorDisplayMode : auto." We have fixed this issue.

Fixed in previous versions

Show details.

More information

See the reference documentation for the OpenTok.js library.

To see sample code and to read more information on using the OpenTok.js library, see the OpenTok Tutorials and Examples page.

For documentation on the OpenTok server-side libraries, see the OpenTok server-side libraries page.

Also check out the OpenTok Help Center.

How to report bugs

We'd love to hear from you! If you have any issues or bugs, you can report them to us at