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){