[Webkit-unassigned] [Bug 217578] New: Webcam video from navigator.mediaDevices.getUserMedia() to 2D canvas fails on Safari on iPhone

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Oct 11 04:47:28 PDT 2020


https://bugs.webkit.org/show_bug.cgi?id=217578

            Bug ID: 217578
           Summary: Webcam video from
                    navigator.mediaDevices.getUserMedia() to 2D canvas
                    fails on Safari on iPhone
           Product: WebKit
           Version: Safari 14
          Hardware: iPhone / iPad
                OS: iOS 13
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: jujjyl at gmail.com

STR:

<html><head></head><body><canvas></canvas><script>
navigator.mediaDevices.getUserMedia({
        audio: false,
        video: true
}).then((stream) => {
        var video = document.createElement('video');
        video.srcObject = stream;
        video.play();
        var canvas = document.querySelector('canvas');
        var c2d = canvas.getContext('2d');
        function draw() {
                canvas.width = video.videoWidth;
                canvas.height = video.videoHeight;
                c2d.drawImage(video, 0, 0, video.videoWidth, video.videoHeight);
                requestAnimationFrame(draw);
        }
        requestAnimationFrame(draw);
});
</script></body></html>

Works on desktop Firefox, Chrome and Edge, and on mobile Android Firefox and Chrome, but produces a black canvas on Safari.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20201011/1a6967d1/attachment.htm>


More information about the webkit-unassigned mailing list