support audio
This commit is contained in:
parent
68b20a8b4f
commit
980d6822d0
@ -46,6 +46,16 @@
|
|||||||
throw new Error("Element don't habe video track")
|
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 offer = await conn.createOffer();
|
const offer = await conn.createOffer();
|
||||||
await conn.setLocalDescription(offer);
|
await conn.setLocalDescription(offer);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user