Skip to content

Instantly share code, notes, and snippets.

@chintamanand
Created June 26, 2017 12:47
Show Gist options
  • Save chintamanand/0333e816f4147499ceaab6722bf6319f to your computer and use it in GitHub Desktop.
Save chintamanand/0333e816f4147499ceaab6722bf6319f to your computer and use it in GitHub Desktop.
opentok videocalling // source https://jsbin.com/jifituk/2
<!DOCTYPE html>
<html>
<head><meta charset="utf-8"></head>
<body>
<title>opentok videocalling</title>
<script src="https://static.opentok.com/v2/js/opentok.min.js"></script>
<script>
var apiKey = "45898662"; //it is the unique API Key
var sessionId = "2_MX40NTg5ODY2Mn5-MTQ5ODE0MzMxMzM3NX5MTDNVRWNTS2lRSzR5dGxNblJ6T1NSd1R-fg"; //it is open talk session
var token = "T1==cGFydG5lcl9pZD00NTg5ODY2MiZzaWc9NjEzNTRjMzFjMmQ3ZmI2MDk1YzAwZjUyZDE1ZjU3OTkyMjdhMjdiMDpzZXNzaW9uX2lkPTJfTVg0ME5UZzVPRFkyTW41LU1UUTVPREUwTXpNeE16TTNOWDVNVEROVlJXTlRTMmxSU3pSNWRHeE5ibEo2VDFOU2QxUi1mZyZjcmVhdGVfdGltZT0xNDk4MTQzMzQ1Jm5vbmNlPTAuODU5ODQyODc0MDY1MjM3MSZyb2xlPXB1Ymxpc2hlciZleHBpcmVfdGltZT0xNDk4NzQ4MTQz"; //generate the token from developer page
var session = OT.initSession(apiKey, sessionId);
session.connect(token,function(err){
if(err)
{
alert("there is an error!!!");
}
else
{
session.publish();
}
});
session.on("streamCreated!!!",function(event){
session.subscribe(event.stream);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment