Web UI for ARGUS server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.2 KiB

6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <html>
  2. <head>
  3. <title>Video Chat</title>
  4. <script type="text/javascript">
  5. window.onload = function () {
  6. var transceiver = new MediaStreamTransceiver("ws://192.168.0.115:8080/delayswitch?sid=0");
  7. var videoDevice = document.getElementsByTagName("device")[0];
  8. videoDevice.onchange = function (evt) {
  9. var videoStream = videoDevice.data;
  10. var selfView = document.getElementById("self_view");
  11. // exclude audio from the self view
  12. selfView.src = videoStream.url + "#video";
  13. selfView.play();
  14. // set the stream to share
  15. transceiver.localStream = videoStream;
  16. };
  17. transceiver.onconnect = function () {
  18. var remoteVideo = document.getElementById("remote_video");
  19. // play the incoming stream
  20. remoteVideo.src = transceiver.remoteStream.url;
  21. remoteVideo.play();
  22. };
  23. }
  24. </script>
  25. </head>
  26. <body>
  27. <div><device type="media"></div>
  28. <div style="float:left">
  29. <p>Self-view:</p>
  30. <video width="320" height="240" id="self_view"></video>
  31. </div>
  32. <div style="float:left">
  33. <p>Remote video:</p>
  34. <video width="320" height="240" id="remote_video"></video>
  35. </div>
  36. </body>
  37. </html>