[Webkit-unassigned] [Bug 248964] New: Screen share does not work when pass width & height to the video constraint in "getDisplayMedia"

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 8 11:29:40 PST 2022


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

            Bug ID: 248964
           Summary: Screen share does not work when pass width & height to
                    the video constraint in "getDisplayMedia"
           Product: WebKit
           Version: Safari 16
          Hardware: Mac (Apple Silicon)
                OS: macOS 13
            Status: NEW
          Severity: Critical
          Priority: P2
         Component: WebRTC
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: rv.maksim at gmail.com
                CC: youennf at gmail.com

Demo source: https://codesandbox.io/s/a-mediastreamtrack-ended-due-to-a-capture-failure-mxrpxc?file=/src/index.js
Demo url: https://mxrpxc.csb.app


Steps to reproduce (A):
- Open "Demo url"
- Press "Share screen" button
- "Allow to share screen"

Expected result: video tag display screen
Actual result: Exception "A MediaStreamTrack ended due to a capture failure"


Steps to reproduce (B):
- Open "Demo url"
- Press "Share screen" button
- "Allow to share window"

Expected result: video tag display window stream
Actual result: nothing


Source code (for history):

```javascript
function main() {
  console.clear();

  const video = document.createElement("video");
  video.autoplay = true;
  video.width = 250;
  video.style.display = "block";
  video.style.border = "1px solid red";

  const button = document.createElement("button");
  button.innerText = "Share screen!";
  button.onclick = async () => {
    const stream = await navigator.mediaDevices.getDisplayMedia({
      video: {
        width: 100,
        height: 100
      }
    });
    video.srcObject = stream;
  };
  document.body.append(video);
  document.body.append(button);
}

main();

```

-- 
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/20221208/d3ee37dd/attachment-0001.htm>


More information about the webkit-unassigned mailing list