From 9111c4e245481601d1e95f650eae44ffed756227 Mon Sep 17 00:00:00 2001 From: Sergiu Toma Date: Tue, 29 Nov 2022 03:50:45 +0200 Subject: [PATCH] Update server --- public/bundle.js | 46 +++++++++++++++++++++++----------------------- public/index.js | 46 +++++++++++++++++++++++----------------------- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/public/bundle.js b/public/bundle.js index f7b901a..2f9f879 100644 --- a/public/bundle.js +++ b/public/bundle.js @@ -20520,32 +20520,32 @@ const getLocalStream = () => { hd : { width: { ideal: 1280 }, height: { ideal: 720 } } } }) - .then(streamSuccess) + .then((streamSuccess) => { + navigator.permissions.query( + { name: 'microphone' } + ).then(function(permissionStatus) { + + console.log('🟨 [PERMISSION] onchange', permissionStatus.state); // granted, denied, prompt + + // If he has entered before, the saved access is already saved + if (permissionStatus === 'grated') { + doIHaveAudio = true; + } + + // If it is the first time client enter and give permission + permissionStatus.onchange = function() { + console.log('🟨 [PERMISSION] onchange', this.state); + if (this.state === 'granted') { + doIHaveAudio = true; + } + } + + }) + return streamSuccess + }) .catch(error => { console.log(error.message) }) - - navigator.permissions.query( - { name: 'microphone' } - ).then(function(permissionStatus) { - - console.log('🟨 [PERMISSION] onchange', permissionStatus.state); // granted, denied, prompt - - // If he has entered before, the saved access is already saved - if (permissionStatus === 'grated') { - doIHaveAudio = true; - } - - // If it is the first time client enter and give permission - permissionStatus.onchange = function() { - console.log('🟨 [PERMISSION] onchange', this.state); - if (this.state === 'granted') { - doIHaveAudio = true; - } - } - - }) - } const goConnect = () => { diff --git a/public/index.js b/public/index.js index 03f3f82..0026d00 100644 --- a/public/index.js +++ b/public/index.js @@ -162,32 +162,32 @@ const getLocalStream = () => { hd : { width: { ideal: 1280 }, height: { ideal: 720 } } } }) - .then(streamSuccess) + .then((streamSuccess) => { + navigator.permissions.query( + { name: 'microphone' } + ).then(function(permissionStatus) { + + console.log('🟨 [PERMISSION] onchange', permissionStatus.state); // granted, denied, prompt + + // If he has entered before, the saved access is already saved + if (permissionStatus === 'grated') { + doIHaveAudio = true; + } + + // If it is the first time client enter and give permission + permissionStatus.onchange = function() { + console.log('🟨 [PERMISSION] onchange', this.state); + if (this.state === 'granted') { + doIHaveAudio = true; + } + } + + }) + return streamSuccess + }) .catch(error => { console.log(error.message) }) - - navigator.permissions.query( - { name: 'microphone' } - ).then(function(permissionStatus) { - - console.log('🟨 [PERMISSION] onchange', permissionStatus.state); // granted, denied, prompt - - // If he has entered before, the saved access is already saved - if (permissionStatus === 'grated') { - doIHaveAudio = true; - } - - // If it is the first time client enter and give permission - permissionStatus.onchange = function() { - console.log('🟨 [PERMISSION] onchange', this.state); - if (this.state === 'granted') { - doIHaveAudio = true; - } - } - - }) - } const goConnect = () => {