Bug 248964
Summary: | Screen share does not work when pass width & height for the video constraint in "getDisplayMedia" | ||
---|---|---|---|
Product: | WebKit | Reporter: | Maksim Ryzhikov <rv.maksim> |
Component: | WebRTC | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Critical | CC: | eric.carlson, jer.noble, ltsg0317, ralphbliu, youennf |
Priority: | P2 | ||
Version: | Safari 16 | ||
Hardware: | Mac (Apple Silicon) | ||
OS: | macOS 13 |
Maksim Ryzhikov
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Maksim Ryzhikov
I have built WebKit from the main branch but problem still present :(
youenn fablet
This is probably fixed in https://bugs.webkit.org/show_bug.cgi?id=247310.
I cannot reproduce the issue in mini browser.
youenn fablet
*** This bug has been marked as a duplicate of bug 247310 ***
Brian Liu
See the solution https://stackoverflow.com/a/75065525/4796724
Maksim Ryzhikov
(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
(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
(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?