page.html 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <!DOCTYPE HTML>
  2. <html lang="en">
  3. <head>
  4. <title>Sink Test</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta http-equiv="Content-Language" content="en-us">
  7. <meta name="description" content="">
  8. <meta name="keywords" content="">
  9. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
  10. <script type="text/javascript" src="/peer.js"></script>
  11. <script>
  12. $(document).ready(function() {
  13. pc1 = new Peer({ video: true });
  14. pc1.on('ready', function(id) {
  15. console.log(id);
  16. pc2 = new Peer({ source: id, audio: true });
  17. });
  18. pc1.on('connection', function(recipient) {
  19. console.log('connection');
  20. pc1.send('Hi there!');
  21. });
  22. pc1.on('data', function(data) {
  23. console.log(data);
  24. });
  25. pc1.on('localstream', function(type, stream) {
  26. console.log('Local stream: ', type);
  27. });
  28. pc1.on('remotestream', function(type, stream) {
  29. console.log('Remote stream: ', type);
  30. });
  31. });
  32. </script>
  33. </head>
  34. <body>
  35. </body>
  36. </html>