WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
258312
getUserMedia produces different results for the same constraints
https://bugs.webkit.org/show_bug.cgi?id=258312
Summary
getUserMedia produces different results for the same constraints
burzomirdev
Reported
2023-06-20 11:14:00 PDT
Video track constraints aren't correctly applied and calling getUserMedia two times in the row with the same constraints provides different results. First time camera tracks is in portrait orientation and ignores constraints that tell it should be landscape. Second time it looks like camera track in portrait orientation is cropped to match the constraints.
https://replit.com/@burzomir/iOS-165-getUserMedia-portrait-video-constraints-issue#index.html
To reproduce open this page on iOS 16.5:
https://ios-165-getusermedia-portrait-video-constraints-issue.burzomir.repl.co
``` async function start(stopFirstStream) { const firstVideo = document.querySelector('#first-video') const secondVideo = document.querySelector('#second-video') const constraints = { video: { width: { ideal: 1280 }, height: { ideal: 720 } } } const firstStream = await navigator.mediaDevices.getUserMedia(constraints) firstVideo.srcObject = firstStream // first stream provides a track in a portrait orientation // ignoring landscape constraints // if not stopped before getting the seconds stream // the video track provided by the second stream is cut to match constraints // tested on iPhone XS iOS 16.5 if (stopFirstStream) { firstStream.getTracks().forEach(track => { track.stop() }) } const secondStream = await navigator.mediaDevices.getUserMedia(constraints) secondVideo.srcObject = secondStream } ```
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2023-06-27 11:14:17 PDT
<
rdar://problem/111401777
>
youenn fablet
Comment 2
2023-07-03 01:55:53 PDT
This does not repro for me on WebKit ToT using the link. Would you be able to test it on iOS 17 beta?
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug