From c5fb07f6da04ee28f622ba316edd696ab797915d Mon Sep 17 00:00:00 2001 From: EpicKiwi Date: Thu, 21 Sep 2023 11:56:20 +0200 Subject: [PATCH] fix --- static/js/grab-canvas.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/static/js/grab-canvas.js b/static/js/grab-canvas.js index b3ccc46..002a8fb 100644 --- a/static/js/grab-canvas.js +++ b/static/js/grab-canvas.js @@ -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){