Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
- <script src="https://simplewebrtc.com/latest-v3.js"></script>
- </head>
- <body>
- <style>
- h1{
- font-family: tahoma;
- }
- </style>
- <a href="index.html"><img src="dux.png"></a>
- <h2 id="nl"></h2>
- <video height="300" id="localVideo"></video>
- <div id="remotesVideos"></div>
- <script>
- var basekey = 'wezrxtygh0-';
- var log = document.getElementById('ip');
- var webrtc = new SimpleWebRTC({
- remoteVideosEl: 'remotesVideos',
- localVideoEl: 'localVideo',
- autoRequestMedia: true,
- url: 'https://xxxxxxxxxx/',
- socketio:{path:"xxxxxxxxx"},
- media: {video: false, audio:true},
- nick: 'Anonymous'+Math.floor((Math.random() * 1000000000) + 100000000)+", "
- });
- var qroom = location.search.match(/key=([a-z0-9]+)/)[1];
- webrtc.joinRoom(basekey+qroom);
- function showVolume(el, volume) {
- if (!el) return;
- if (volume < -45) volume = -45;
- if (volume > -20) volume = -20;
- el.value = volume;
- }
- webrtc.on('videoAdded', function (video, peer) {
- document.getElementById("nl").textcontext = peer.nick;
- });
- webrtc.on('videoAdded', function (video, peer) {
- console.log('videoAdded', peer.nick);
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement