Use the latest OpenTok.js beta to test WebRTC functionality with the upcoming Safari 11 browser.
This is a beta feature. Please send comments and issue reports for this beta program to firstname.lastname@example.org.
The upcoming version of Apple’s Safari browser (Safari 11) for Mac and iOS will support WebRTC, and now TokBox users can begin testing out Safari’s new WebRTC functionality with the latest beta version of the OpenTok.js client-side library.
While you won’t be able to add this functionality to your production application yet, you will be able to create new test projects using the beta. This is a great opportunity to stay ahead of the curve and begin building Safari compatibility into your application in anticipation of general availability (GA) for Safari 11.
Also see the list of known issues.
If you would like to see the beta in action, see our demo.
In order to begin testing Safari’s WebRTC functionality in an application, you must follow a specific set of steps:
Additional beta resources:
If you don’t already have a TokBox account, sign up for a free trial (no credit card required).
Log into your TokBox Account page.
At the top of the page click Create Safari Beta Project.
This will generate a beta API Key and API Secret. You will need these credentials when developing your application.
After creating the project, you can proceed to your Project Page.
This is where you can access your project credentials and generate session IDs and tokens for testing your application. (To learn more about sessions and tokens, see OpenTok Basics). You can return to your Project Page anytime by selecting it from the Projects tab in the left-hand menu of your Account page.
If you’ve already developed a web application with OpenTok and would like to test it with the new Safari Beta, you’ll need to make a few adjustments:
Instead of referencing the current OpenTok.js build (
https://static.opentok.com/v2/js/opentok.min.js) in your client-side code, update your code to use the beta version of OpenTok.js:
Ensure that all OpenTok session IDs and tokens being used in your application are generated from your new Safari Beta Project.
If you already have a server component generating your connection credentials, you’ll need to update your server code to use your new beta API Key and API Secret. Otherwise you can either generate session IDs and tokens manually from your Safari Beta Project page or set up an authentication server using the OpenTok server SDKs and your new Project credentials.
If you’re building a new OpenTok web application, you can follow the Set up a Basic Web Client Tutorial to build a basic video chat application with OpenTok, then make the same adjustments as above. You can also view the pre-made demo if you would like to see the new functionality without your own application.
The adjustments made above will only work on the Safari 11 browser, which is only accessible by downloading and installing any of the following:
Once you’ve installed one of the releases above, load your application in the Safari browser to test it out. The application will also be compatible with Google Chrome and Firefox.
Important: A project using the OpenTok.js beta and/or Beta Project keys will not work with Safari 10 (the current release of the Safari browser.)
If you’ve already downloaded and installed the Safari Technology Preview, macOS 10.13, or iOS 11, load this page in Safari 11 and click below to view our demo app. Note that this demo will not work with the current production version of Safari (Safari 10.)View Safari beta demo
You will not be charged for any minutes generated using your Safari Beta Project. Any TokBox users who create a Safari Beta Project will be notified via email about any upcoming changes in pricing.
The following are known issues in the beta version of OpenTok.js:
Safari 11 includes auto-play video blocking, which requires a user gesture to start video
playback, including playback of video for OpenTok subscribers. Calling the
Session.subscribe() method before the user has started video playback will cause
subscribing to fail. One way to work around this issue is to call
and wait for the completion handler to be called without an error (indicating that the user has
allowed access to the camera and microphone) before subscribing to OpenTok streams.
Safari 11 does not support camera access (or stream publishing) in pages loaded using the http: (insecure) or file: (file system) URI schemes. You must serve the page over https: (secure) .
Also see the Safari technology preview release notes.
Do I need to pay for usage generated from my Safari Beta project(s)?
No. For the duration of the beta, you will not be charged for any minutes generated using your Safari Beta Project.
Can I create more than one Safari Beta project?
Yes. You can create as many Safari Beta projects as you would like. These projects will be tagged “beta” in your projects list on your TokBox Account page.
How do I get the API Key and API Secret for a beta project I already created?
You can access your existing Safari Beta Projects from the left menu of your TokBox Account page. Click on the project name to visit the Project Page, where you can access your account keys and generate new session IDs and tokens for your test project.
When will this functionality be available with non-beta versions of Safari and OpenTok?
We will be adding additional endpoints and functionality throughout the beta period. Check back for more updates as Safari 11 approaches general availability (GA).
Can I use the OpenTok.js beta with my app in production?
Due to some limitations in functionality and interoperability, you should not use the OpenTok.js beta SDK in any production application.
How can I provide feedback about the beta version of OpenTok.js?
Please send any comments or issue reports for the Safari browser support beta program to email@example.com.