Skip to content

Instantly share code, notes, and snippets.

@toshi3221
Created June 9, 2013 14:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toshi3221/5743827 to your computer and use it in GitHub Desktop.
Save toshi3221/5743827 to your computer and use it in GitHub Desktop.
simpleWebRTC
<!DOCTYPE html>
<html>
<head>
<script src="http://simplewebrtc.com/latest.js"></script>
</head>
<body>
<div id="localVideo"></div>
<div id="remotesVideos"></div>
<script>
var webrtc = new WebRTC({
// the id/element dom element that will hold "our" video
localVideoEl: 'localVideo',
// the id/element dom element that will hold remote videos
remoteVideosEl: 'remotesVideos',
// immediately ask for camera access
autoRequestMedia: true
});
// we have to wait until it's ready
webrtc.on('readyToCall', function () {
// you can name it anything
webrtc.joinRoom('SimpleWebRTC tiramisu test');
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment