diff --git a/static/js/grab-canvas.js b/static/js/grab-canvas.js index 3fe29b9..6798604 100644 --- a/static/js/grab-canvas.js +++ b/static/js/grab-canvas.js @@ -46,14 +46,11 @@ throw new Error("Element don't habe video track") } - const canvasAudioTracks = canvasStream.getAudioTracks() - if(canvasAudioTracks.length > 0){ - const AudioContext = window.AudioContext || window.webkitAudioContext; - if(AudioContext){ - const audioContext = new AudioContext(); - audioContext.createMediaStreamTrackSource(canvasAudioTracks[0]) - .connect(audioContext.destination) - } + const AudioContext = window.AudioContext || window.webkitAudioContext; + if(AudioContext){ + const audioContext = new AudioContext(); + audioContext.createMediaStreamSource(canvasStream) + .connect(audioContext.destination) } const offer = await conn.createOffer();