RESOLVED DUPLICATE of bug 247310 Bug 248964
Screen share does not work when pass width & height for the video constraint in "getDisplayMedia"
https://bugs.webkit.org/show_bug.cgi?id=248964
Summary Screen share does not work when pass width & height for the video constraint ...
Maksim Ryzhikov
Reported 2022-12-08 11:29:40 PST
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(); ```
Attachments
Maksim Ryzhikov
Comment 1 2022-12-08 11:33:47 PST
I have built WebKit from the main branch but problem still present :(
youenn fablet
Comment 2 2022-12-09 02:17:19 PST
This is probably fixed in https://bugs.webkit.org/show_bug.cgi?id=247310. I cannot reproduce the issue in mini browser.
youenn fablet
Comment 3 2022-12-09 02:44:14 PST
*** This bug has been marked as a duplicate of bug 247310 ***
Brian Liu
Comment 4 2023-01-09 20:42:16 PST
Maksim Ryzhikov
Comment 5 2023-01-10 01:11:48 PST
(In reply to Brian Liu from comment #4) > See the solution https://stackoverflow.com/a/75065525/4796724 Thanks, but this is not a solution. This is the one of possible workarounds which may or may not suite.
Maksim Ryzhikov
Comment 6 2023-01-10 01:12:30 PST
(In reply to Brian Liu from comment #4) > See the solution https://stackoverflow.com/a/75065525/4796724 Thanks, but this is not a solution. This is the one of possible workarounds which may or may not suite.
shuming
Comment 7 2023-03-02 01:44:06 PST
(In reply to Brian Liu from comment #4) > See the solution https://stackoverflow.com/a/75065525/4796724 Even though it can be called, there is still no limit to the collection resolution, so far the collection is always 1080, my version is Safari16.3. Has anyone else been in this situation?
Note You need to log in before you can comment on or make changes to this bug.