BLUSHIF

Untitled

Jul 30th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <body>
  5. <div id="remotes"></div>
  6. <div id="remotesVideos"></div>
  7. <video height="300" id="localVideo"></video>
  8. <script src="./nw1/out/simplewebrtc-with-adapter.bundle.js"></script>
  9. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
  10. <script>
  11. var webrtc = new SimpleWebRTC({
  12. remoteVideosEl: 'remotesVideos',
  13. localVideoEl: 'localVideo',
  14. autoRequestMedia: true,
  15. detectSpeakingEvents: true,
  16. autoAdjustMic: false,
  17. url: 'https://www.hokucode.com/',
  18. socketio: {
  19. path: "/signal/socket.io"
  20. },
  21. media: {
  22. video: false,
  23. audio: true
  24. },
  25. debug: false
  26. });
  27. webrtc.on('readyToCall', function () {
  28. webrtc.joinRoom('coc');
  29. });
  30. SimpleWebRTC.sendDirectlyToAll(
  31. 'meta',
  32. 'info',
  33. {"foo": "bar"}
  34. );
  35. SimpleWebRTC.on('channelMessage', function (Peer, Label, Data) {
  36. if ('hark' === Label) {
  37. return true;
  38. }
  39. if ('meta' === Label) {
  40.  
  41. if ('info' === Data.type)
  42. {
  43. console.log(Data.payload.foo);
  44. }
  45. }
  46. }
  47. </script>
  48. </head>
  49. </body>
  50. </html>
Advertisement
Add Comment
Please, Sign In to add comment