Handle error on audio dispatching

This commit is contained in:
EpicKiwi 2023-09-21 12:31:40 +02:00
parent d5c8fcd055
commit e5b57dd3d7
Signed by: epickiwi
GPG Key ID: C4B28FD2729941CE

View File

@ -46,11 +46,15 @@
throw new Error("Element don't habe video track")
}
const AudioContext = window.AudioContext || window.webkitAudioContext;
if(AudioContext){
const audioContext = new AudioContext();
audioContext.createMediaStreamSource(canvasStream)
.connect(audioContext.destination)
try {
const AudioContext = window.AudioContext || window.webkitAudioContext;
if(AudioContext){
const audioContext = new AudioContext();
audioContext.createMediaStreamSource(canvasStream)
.connect(audioContext.destination)
}
} catch(e){
console.warn(e)
}
const offer = await conn.createOffer();