[Webkit-unassigned] [Bug 228860] New: Safari automatically reloads page when takes photos in max resolution on iPhone 7, iPhone 7 Plus.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 6 03:36:27 PDT 2021


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

            Bug ID: 228860
           Summary: Safari automatically reloads page when takes photos in
                    max resolution on iPhone 7, iPhone 7 Plus.
           Product: WebKit
           Version: Safari 14
          Hardware: iPhone / iPad
                OS: iOS 14
            Status: NEW
          Severity: Minor
          Priority: P2
         Component: WebRTC
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: andrew.zaitsev.crtr at gmail.com
                CC: youennf at gmail.com

There is a Web RTC video stream with max resolution and video tag which shows the stream from the camera.

async function setStream() {
  const stream = await window.navigator.mediaDevices.getUserMedia({
        video: {
          facingMode: 'user',
          width: {
            min: 960,
            ideal: resolution.width,
          },
          height: {
            min: 720,
            ideal: resolution.height,
          },
          frameRate: {
            min: 30,
          },
          aspectRatio: {
            ideal: RESOLUTION_ASPECT_RATIO,
          },
        },
        audio: false,
      });

  videoNode.srcObject = stream;
}

It's possible to take photos by clicking on the button, this code will be run:

function takePhoto() {
    const canvasNode = document.createElement('canvas');
    canvasNode.width = videoWidth;
    canvasNode.height = videoHeight;

    const context = canvasNode.getContext('2d')!;

    context.drawImage(videoNode, 0, 0, videoWidth, videoHeight);

    const photo = canvasNode.toDataURL('image/jpeg', 1.0);
}

After that, will close all tracks:

stream.getTracks().forEach((track) => track.stop());

Next will show the taken image. 

There are three the same steps, step by step in my flow.

Issue: 
Sometimes Safari will reload the page. How I can resolve this issue?

-- 
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/20210806/de675ed9/attachment.htm>


More information about the webkit-unassigned mailing list