HTML5-SimpleWebRTC 实现视频通话

<!DOCTYPE html>
<html>
    <head>
        <script src="js/latest.js"></script> 
    </head>
    <body>
        <video height="300" id="localVideo"></video>
        <div height="300" id="remotesVideos"></div>
    </body>
    <script>
    var webrtc = new SimpleWebRTC({
    	  // 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('your awesome room name');
    });
    </script>
</html>

因为这里不能传附件,

js在http://www.oschina.net/code/snippet_128886_37109 


你可能感兴趣的:(html5,视频通话,SimpleWebRTC)