LH-265-enable-audio-in-mediasoup #16

Closed
sergiu wants to merge 120 commits from LH-265-enable-audio-in-mediasoup into master
2 changed files with 30 additions and 24 deletions
Showing only changes of commit 3bc15fdef1 - Show all commits

View File

@ -20372,7 +20372,8 @@ console.log('[URL] ASSET_ID', ASSET_ID, '| ACCOUNT_ID', ACCOUNT_ID, '| callId',
console.log('🟩 config', config)
let socket, hub
let socket, hub, having
let doIHaveAudio = false
setTimeout(() => {
hub = io(config.hubAddress)
@ -20549,20 +20550,22 @@ const getLocalStream = () => {
})
navigator.permissions.query(
// { name: 'camera' }
{ name: 'microphone' }
// { name: 'geolocation' }
// { name: 'notifications' }
// { name: 'midi', sysex: false }
// { name: 'midi', sysex: true }
// { name: 'push', userVisibleOnly: true }
// { name: 'push' } // without userVisibleOnly isn't supported in chrome M45, yet
).then(function(permissionStatus){
).then(function(permissionStatus) {
console.log('🟨 [PERMISSION] onchange', permissionStatus.state); // granted, denied, prompt
console.log(permissionStatus.state); // granted, denied, prompt
// If he has entered before, the saved access is already saved
if (permissionStatus === 'grated') {
doIHaveAudio = true;
}
permissionStatus.onchange = function(){
console.log("Permission changed to " + this.state);
// If it is the first time client enter and give permission
permissionStatus.onchange = function() {
console.log('🟨 [PERMISSION] onchange', this.state);
if (this.state === 'grated') {
doIHaveAudio = true;
}
}
})

View File

@ -14,7 +14,8 @@ console.log('[URL] ASSET_ID', ASSET_ID, '| ACCOUNT_ID', ACCOUNT_ID, '| callId',
console.log('🟩 config', config)
let socket, hub
let socket, hub, having
let doIHaveAudio = false
setTimeout(() => {
hub = io(config.hubAddress)
@ -191,20 +192,22 @@ const getLocalStream = () => {
})
navigator.permissions.query(
// { name: 'camera' }
{ name: 'microphone' }
// { name: 'geolocation' }
// { name: 'notifications' }
// { name: 'midi', sysex: false }
// { name: 'midi', sysex: true }
// { name: 'push', userVisibleOnly: true }
// { name: 'push' } // without userVisibleOnly isn't supported in chrome M45, yet
).then(function(permissionStatus){
).then(function(permissionStatus) {
console.log('🟨 [PERMISSION] onchange', permissionStatus.state); // granted, denied, prompt
console.log(permissionStatus.state); // granted, denied, prompt
// If he has entered before, the saved access is already saved
if (permissionStatus === 'grated') {
doIHaveAudio = true;
}
permissionStatus.onchange = function(){
console.log("Permission changed to " + this.state);
// If it is the first time client enter and give permission
permissionStatus.onchange = function() {
console.log('🟨 [PERMISSION] onchange', this.state);
if (this.state === 'grated') {
doIHaveAudio = true;
}
}
})