In M1 Ventura safari 16.1, when the constraints passed in by getDisplayMedia contain the 'ideal' parameter, screen sharing will fail. Tested devices and browsers: Bug is reproducible with Safari on: - M1 Pro (MacOS Ventura) safari 16.1 (18614.2.9.1.12) --------------------------------------------------------------- Use case: Failed: https://zhangyuwei-1254112368.cos.ap-guangzhou.myqcloud.com/safari/gdm-ideal-failed.html constraints: { video: { width: { ideal: 1920, max: 1920 }, audio: { ideal: 1080, max: 1080 } } } Success: https://zhangyuwei-1254112368.cos.ap-guangzhou.myqcloud.com/safari/gdm-success.html constraints: { video: { width: { max: 1920 }, audio: { max: 1080 } } }
<rdar://problem/101819966>
Created attachment 463382 [details] Share screenshot We also faced this issue some additions: - there no possibility to get resolution another than 1920x1080 1280x720 doesn't work navigator.mediaDevices( { video: { width: 1280, audio: 720 } } ); - if I call navigator.mediaDevices({video: true}) and select macbook screen video has black lines on the sides (this is because video resolution is 1920x1080 but macboocs screen has another resolution and another aspect ratio) tested with macbook pro 16 2019 (Intel) MacOS Ventura
Created attachment 463383 [details] application window share screenshot if I call navigator.mediaDevices.getDisplayMedia({video: true}); and select some small application window (like calculator) video will have 1920x1080 resolution (see screenshot)
I can reproduce, it seems our call to createBufferPool fails with kCVReturnInvalidPixelBufferAttributes.
Pull request: https://github.com/WebKit/WebKit/pull/6199
(In reply to youenn fablet from comment #5) > Pull request: https://github.com/WebKit/WebKit/pull/6199 This PR only fixes window capture.
Committed 256458@main (882a38ecdaf1): <https://commits.webkit.org/256458@main> Reviewed commits have been landed. Closing PR #6199 and removing active labels.
*** Bug 247883 has been marked as a duplicate of this bug. ***
*** Bug 248964 has been marked as a duplicate of this bug. ***
See the solution https://stackoverflow.com/a/75065525/4796724