OpenTok.js Change

Over the last several months, we’ve focused on why end-users have difficulty connecting to OpenTok sessions to try to understand how we can make this easier.

We found that many end-users failed to allow hardware access to their cameras and microphones through Google Chrome and Mozilla Firefox dialog boxes. Some of you have already tried to solve this problem on your own by creating a custom UI that highlights the prompt. However, the OpenTok platform should solve this problem for you and your end-users.

And so, we’re happy to introduce our allow/deny UI, which will be released as a part of our standard JavaScript library. It will educate end-users about the hardware access dialog making it clear that end-users must allow hardware access for digital communication. It will also show how end-users can re-enable hardware access if they previously denied it.

This change will be released in both OpenTok.js 2.0 and OpenTok.js 2.2 in the second half of May. If you want take advantage of it, you don’t have to do a thing: it will automatically update. If, for some reason, you want to disable it (and/or build your own UI), you can use the code below:

OT.initPublisher().on({
	accessDialogOpened: function(event) {
		event.preventDefault();
		alert("Click allow!");
	},
	accessDenied: function(event) {
		event.preventDefault();
		alert("You said no. You don't get a publisher. Sorry.");
	}
});

If you have any questions, feature requests, or bugs to report on the allow/deny UI or anything else in the OpenTok.js library, please post in our forums.

  • Cristian Pereyra

    Hello, how can I customize the messages for this? I want to translate this to spanish.