This commit is contained in:
EpicKiwi 2023-09-21 11:56:20 +02:00
parent c4f1e4d8c0
commit c5fb07f6da
Signed by: epickiwi
GPG Key ID: C4B28FD2729941CE

View File

@ -27,6 +27,16 @@
captureFn = sourceElt.mozCaptureStream;
}
if(sourceElt instanceof HTMLCanvasElement){
captureFn = sourceElt.captureStream.bind(sourceElt)
} else {
if(sourceElt.mozCaptureStream){
captureFn = sourceElt.mozCaptureStream.bind(sourceElt)
} else {
captureFn = sourceElt.captureStream.bind(sourceElt)
}
}
const canvasStream = captureFn()
const canvasStreamTracks = canvasStream.getVideoTracks()
if(canvasStreamTracks.length > 0){