Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
  5. <script src="https://simplewebrtc.com/latest-v3.js"></script>
  6. </head>
  7. <body>
  8. <style>
  9. h1{
  10. font-family: tahoma;
  11. }
  12. </style>
  13. <a href="index.html"><img src="dux.png"></a>
  14. <h2 id="nl"></h2>
  15. <video height="300" id="localVideo"></video>
  16. <div id="remotesVideos"></div>
  17. <script>
  18. var basekey = 'wezrxtygh0-';
  19. var log = document.getElementById('ip');
  20. var webrtc = new SimpleWebRTC({
  21. remoteVideosEl: 'remotesVideos',
  22. localVideoEl: 'localVideo',
  23. autoRequestMedia: true,
  24. url: 'https://xxxxxxxxxx/',
  25. socketio:{path:"xxxxxxxxx"},
  26. media: {video: false, audio:true},
  27. nick: 'Anonymous'+Math.floor((Math.random() * 1000000000) + 100000000)+", "
  28. });
  29. var qroom = location.search.match(/key=([a-z0-9]+)/)[1];
  30. webrtc.joinRoom(basekey+qroom);
  31. function showVolume(el, volume) {
  32. if (!el) return;
  33. if (volume < -45) volume = -45;
  34. if (volume > -20) volume = -20;
  35. el.value = volume;
  36. }
  37. webrtc.on('videoAdded', function (video, peer) {
  38. document.getElementById("nl").textcontext = peer.nick;
  39. });
  40. webrtc.on('videoAdded', function (video, peer) {
  41. console.log('videoAdded', peer.nick);
  42. });
  43. </script>
  44. </body>
  45. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement