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(); ```
I have built WebKit from the main branch but problem still present :(
This is probably fixed in https://bugs.webkit.org/show_bug.cgi?id=247310. I cannot reproduce the issue in mini browser.
*** This bug has been marked as a duplicate of bug 247310 ***
See the solution https://stackoverflow.com/a/75065525/4796724
(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.
(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?