Created
July 20, 2012 20:34
-
-
Save jonmumm/3153071 to your computer and use it in GitHub Desktop.
OpenTok Hello World
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
<head> | |
<title>OpenTok Getting Started</title> | |
<script src="http://staging.tokbox.com/v0.91/js/TB.min.js"></script> | |
<script type="text/javascript"> | |
var apiKey = '1127'; | |
var sessionId = '14685d1ac5907f4a2814fed28294d3f797f34955'; | |
var token = 'devtoken'; | |
TB.setLogLevel(TB.DEBUG); | |
var session = TB.initSession(sessionId); | |
session.addEventListener('sessionConnected', sessionConnectedHandler); | |
session.connect(apiKey, token); | |
var publisher; | |
function sessionConnectedHandler(event) { | |
// Put my webcam in a div | |
publisher = TB.initPublisher('myPublisherDiv'); | |
// Send my stream to the session | |
session.publish(publisher); | |
} | |
</script> | |
</head> | |
<body> | |
<div id="myPublisherDiv"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment