X-Git-Url: https://git.kengrimes.com/?p=henge%2Fkiak.git;a=blobdiff_plain;f=host.js;h=81aabc678264acbe567da1ddd79869c6072212c9;hp=01c56a2d1c5c77f021074aee402dab717bb60b30;hb=bf0ef83964741dcd64d27a8da651e65beba7e451;hpb=5da8f7e044a781c15567b43ee9acc07444605015 diff --git a/host.js b/host.js index 01c56a2..81aabc6 100644 --- a/host.js +++ b/host.js @@ -1,4 +1,6 @@ document.title = "Strapp.io Host" + + const conf = {"iceServers": [{ "urls": "stun:stun.1.google.com:19302" }] } const clients = new Map([]) const iceCandidates = [] @@ -154,6 +156,22 @@ if ("WebSocket" in window) { } } } + document.body.innerHTML = '
Choose options for client
' + + navigator.mediaDevices.getUserMedia({ video : { mediaSource: "screen", // whole screen sharing + // mediaSource: "window", // choose a window to share + // mediaSource: "application", // choose a window to share + width: {max: '1920'}, + height: {max: '1080'}, + frameRate: {max: '10'}} }) + .then(function(mediaStream) { + let video = document.querySelector('video') + video.srcObject = mediaStream + video.onloadedmetadata = function(e) { + video.play() + } + }) + .catch(function(err) { console.log(err); }); // always check for errors at the end. }) } else {