OpenTok version 2.13: What’s new and how you can use it

opentok v2.13 new features

We recently released the latest version of our Client SDKs, v2.13.0 and I wanted to share some of the great new features that have gone out with this release.

Custom Media Streaming

With v2.13.0 of opentok.js we have added the ability to pass a custom audioSource and videoSource when you create a Publisher. The custom audio and video source are MediaStreamTrack objects. This enables quite a few different use cases that our customers have been asking for.

Publishing from a Canvas Tag

The simplest thing that this enables is the ability to publish the contents of a Canvas element. This means that anything you can draw on a Canvas you can now stream into an OpenTok Session and you can even archive with our Archiving API. Examples of where this might be useful are:

  • Streaming a shared whiteboard
  • Streaming the contents of an online game
  • Animoji video chat

To see a simple demo of this in action check out our new Publishing from a Canvas sample application.

Stream Filters

stream filters opentok SDK v2.13You can also use the custom videoSource to apply your own filter to the video. This filter is on the actual underlying video so the result will show up in your archives as well. To see a demo of this in action check out the new Stream-Filter sample application.

You could also use this same technique to solve other interesting use-cases like:

  • Adding branding or a watermark to the video
  • Adding subtitles to a video
  • Face detection

Publishing from a Video Tag

publishing from a video tag OpenTok SDK v2.13

In Chrome 53+ it’s also possible to call captureStream on an HTMLMediaElement. This means that you can capture video and audio from a Video element that you are playing or audio from an Audio element. This means that people can watch videos or listen to music together!

To see a demo of this in action check out the new Publish-Video sample application.

H.264 Support

In June last year we announced Beta support and in September we announced full support for Safari 11. With Safari the one caveat is that it only supports H.264 as the video codec.

We have been working tirelessly to make all of our endpoints support H.264 so that we have full compatibility with Safari. With v2.12.0 our iOS SDK, Firefox, Chrome and Edge browsers all supported H.264. Now with v2.13.0 our Android SDK, Windows SDK and our plugin for Internet Explorer 11 all support H.264 as well. This means that all of our clients can now stream video to and from a Safari endpoint. All the more reason to opt-in to a Safari project.

Publisher Stats

publisher stats opentok SDK v2.13

We have supported getStats on a Subscriber for quite some time now and have written some articles about how best to use those stats. Sometimes though it’s hard to tell when looking at the stats whether you are getting bad performance because of the Publisher side or the Subscriber side.

With v2.13.0 of opentok.js we have added getStats to the Publisher. This means you can tell whether end users have a poor uplink on their internet connection as well as telling that the downlink is poor.

Stereo Audio Support

We have seen some really interesting use-cases for improved audio quality on our platform including remote stethoscopes. With v2.13.0 we are adding one more feature to our Audio Tuning API, the ability to stream in stereo audio. This means that if you are using the aforementioned Custom Streaming API to stream a video or audio file, or if you have a stereo microphone, you can stream that audio in stereo.

To see an example of this in action check out our new stereo audio sample application. This sample actually combines 2 of our new features in v2.13.0, Custom Media Streaming and Stereo Audio Support.

Fixed Issues

As well as adding all these great new features in v2.13.0, we have also resolved some issues. For a full list of the features and fixes in our client SDKs have a look at the release notes.