LH-265-enable-audio-in-mediasoup #16
@ -20521,26 +20521,30 @@ const getLocalStream = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then((streamSuccess) => {
|
.then((streamSuccess) => {
|
||||||
navigator.permissions.query(
|
try {
|
||||||
{ name: 'microphone' }
|
navigator.permissions.query(
|
||||||
).then(function(permissionStatus) {
|
{ name: 'microphone' }
|
||||||
|
).then(function(permissionStatus) {
|
||||||
|
|
||||||
console.log('🟨 [PERMISSION] onchange', permissionStatus.state); // granted, denied, prompt
|
console.log('🟨 [PERMISSION] onchange', permissionStatus.state); // granted, denied, prompt
|
||||||
|
|
||||||
// If he has entered before, the saved access is already saved
|
// If he has entered before, the saved access is already saved
|
||||||
if (permissionStatus === 'grated') {
|
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;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
console.log('eeeeee', error);
|
||||||
|
}
|
||||||
return streamSuccess
|
return streamSuccess
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
@ -163,26 +163,30 @@ const getLocalStream = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then((streamSuccess) => {
|
.then((streamSuccess) => {
|
||||||
navigator.permissions.query(
|
try {
|
||||||
{ name: 'microphone' }
|
navigator.permissions.query(
|
||||||
).then(function(permissionStatus) {
|
{ name: 'microphone' }
|
||||||
|
).then(function(permissionStatus) {
|
||||||
|
|
||||||
console.log('🟨 [PERMISSION] onchange', permissionStatus.state); // granted, denied, prompt
|
console.log('🟨 [PERMISSION] onchange', permissionStatus.state); // granted, denied, prompt
|
||||||
|
|
||||||
// If he has entered before, the saved access is already saved
|
// If he has entered before, the saved access is already saved
|
||||||
if (permissionStatus === 'grated') {
|
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;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
console.log('eeeeee', error);
|
||||||
|
}
|
||||||
return streamSuccess
|
return streamSuccess
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
Loading…
Reference in New Issue
Block a user