From 9a33ce12fc8a6c568c9265a80ac48681a9746225 Mon Sep 17 00:00:00 2001 From: "Glitch (peerjs-video)" Date: Sat, 12 Sep 2020 23:10:13 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=92=F0=9F=91=BB=20Checkpoint=20./views?= =?UTF-8?q?/index.ejs:5975361/57=20./public/main.js:5975361/864?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/main.js | 21 +++++++++------------ views/index.ejs | 6 +++--- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/public/main.js b/public/main.js index fb4eb78..1add5bb 100644 --- a/public/main.js +++ b/public/main.js @@ -25,6 +25,9 @@ var app = new Vue({ videoCalls:[], connections: [], chatInput: '', + displayMediaStrean: false, + outgoingScreenShareCalls: [], + incomingScreenShareCalls: [], }, methods: { logMessage: function(message) { @@ -299,10 +302,9 @@ var app = new Vue({ }, getAudioStream: async function getAudioStream() { const audioSource = document.querySelector('select#audioSource').value; - // const videoSource = document.querySelector('select#videoSource').value; const constraints = { audio: {deviceId: audioSource ? {exact: audioSource} : undefined}, - // video: {deviceId: undefined} + video: null }; const audioStream = await navigator.mediaDevices.getUserMedia(constraints).catch(this.handleError); console.log('GOT AUDIO STREAM', audioStream); @@ -320,18 +322,13 @@ var app = new Vue({ return videoStream; }, shareScreen: async function shareScreen() { - // if (!displayMediaStream) { + if (!this.displayMediaStream) { const displayMediaStream = await navigator.mediaDevices.getDisplayMedia(); console.log('screenShare', displayMediaStream) - // } - // senders.find(sender => sender.track.kind === 'video').replaceTrack(displayMediaStream.getTracks()[0]); - - //show what you are showing in your "self-view" video. - // document.getElementById('self-view').srcObject = displayMediaStream; - - //hide the share button and display the "stop-sharing" one - // document.getElementById('share-button').style.display = 'none'; - // document.getElementById('stop-share-button').style.display = 'inline'; + } else { + // TODO stop stream + this.displayMediaStream = false; + } }, handleError: function handleError(error) { console.log('navigator.MediaDevices.getUserMedia error: ', error.message, error.name); diff --git a/views/index.ejs b/views/index.ejs index 1c44b10..938e96f 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -51,7 +51,7 @@
-
+
@@ -79,7 +79,7 @@
-
+
Control
@@ -121,7 +121,7 @@
-
+
Audio connections