Skip to content

Instantly share code, notes, and snippets.

@teddywing
Created June 13, 2014 00:30
Show Gist options
  • Save teddywing/299564b5e106c5913871 to your computer and use it in GitHub Desktop.
Save teddywing/299564b5e106c5913871 to your computer and use it in GitHub Desktop.
OpenTok API v1 accessDenied event handler example
<html>
<head>
<meta charset="utf-8">
<title>Opentok Quick Start</title>
<script src="//static.opentok.com/v1.1/js/TB.min.js"></script>
<script>
// Initialize API key, session, and token...
// Think of a session as a room, and a token as the key to get in to the room
// Sessions and tokens are generated on your server and passed down to the client
var api_key = "YOUR API KEY";
var session_id = "YOUR SESSION ID";
var token = "YOUR TOKEN";
var publisher = TB.initPublisher(api_key);
publisher.addEventListener('accessDenied', access_denied_handler);
function access_denied_handler (event) {
document.getElementById('status-message').innerHTML = 'You should click the “Allow” button if you want to join this video conference.';
}
</script>
</head>
<body>
<h1>Access Denied Event Example</h1>
<div id="myPublisherDiv"></div>
<div id="status-message"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment