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 76 additions and 30 deletions
Showing only changes of commit d17b035526 - Show all commits

View File

@ -20529,22 +20529,45 @@ const getLocalStream = () => {
console.log('🟨 [PERMISSION] onchange', this.state);
if (this.state === 'granted') {
doIHaveAudio = true;
navigator.mediaDevices.getUserMedia({
audio: true,
video: {
qvga : { width: { ideal: 320 }, height: { ideal: 240 } },
vga : { width: { ideal: 640 }, height: { ideal: 480 } },
hd : { width: { ideal: 1280 }, height: { ideal: 720 } }
}
})
.then(streamSuccess)
.catch(error => {
console.log(error.message)
})
} else if (this.state === 'denied') {
doIHaveAudio = false;
navigator.mediaDevices.getUserMedia({
audio: false,
video: {
qvga : { width: { ideal: 320 }, height: { ideal: 240 } },
vga : { width: { ideal: 640 }, height: { ideal: 480 } },
hd : { width: { ideal: 1280 }, height: { ideal: 720 } }
}
})
.then(streamSuccess)
.catch(error => {
console.log(error.message)
})
}
navigator.mediaDevices.getUserMedia({
audio: true,
video: {
qvga : { width: { ideal: 320 }, height: { ideal: 240 } },
vga : { width: { ideal: 640 }, height: { ideal: 480 } },
hd : { width: { ideal: 1280 }, height: { ideal: 720 } }
}
})
.then((streamSuccess) => {
return streamSuccess
})
.catch(error => {
console.log(error.message)
})
// navigator.mediaDevices.getUserMedia({
// audio: true,
// video: {
// qvga : { width: { ideal: 320 }, height: { ideal: 240 } },
// vga : { width: { ideal: 640 }, height: { ideal: 480 } },
// hd : { width: { ideal: 1280 }, height: { ideal: 720 } }
// }
// })
// .then(streamSuccess)
// .catch(error => {
// console.log(error.message)
// })
}
})

View File

@ -171,22 +171,45 @@ const getLocalStream = () => {
console.log('🟨 [PERMISSION] onchange', this.state);
if (this.state === 'granted') {
doIHaveAudio = true;
navigator.mediaDevices.getUserMedia({
audio: true,
video: {
qvga : { width: { ideal: 320 }, height: { ideal: 240 } },
vga : { width: { ideal: 640 }, height: { ideal: 480 } },
hd : { width: { ideal: 1280 }, height: { ideal: 720 } }
}
})
.then(streamSuccess)
.catch(error => {
console.log(error.message)
})
} else if (this.state === 'denied') {
doIHaveAudio = false;
navigator.mediaDevices.getUserMedia({
audio: false,
video: {
qvga : { width: { ideal: 320 }, height: { ideal: 240 } },
vga : { width: { ideal: 640 }, height: { ideal: 480 } },
hd : { width: { ideal: 1280 }, height: { ideal: 720 } }
}
})
.then(streamSuccess)
.catch(error => {
console.log(error.message)
})
}
navigator.mediaDevices.getUserMedia({
audio: true,
video: {
qvga : { width: { ideal: 320 }, height: { ideal: 240 } },
vga : { width: { ideal: 640 }, height: { ideal: 480 } },
hd : { width: { ideal: 1280 }, height: { ideal: 720 } }
}
})
.then((streamSuccess) => {
return streamSuccess
})
.catch(error => {
console.log(error.message)
})
// navigator.mediaDevices.getUserMedia({
// audio: true,
// video: {
// qvga : { width: { ideal: 320 }, height: { ideal: 240 } },
// vga : { width: { ideal: 640 }, height: { ideal: 480 } },
// hd : { width: { ideal: 1280 }, height: { ideal: 720 } }
// }
// })
// .then(streamSuccess)
// .catch(error => {
// console.log(error.message)
// })
}
})