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 } ```
<rdar://problem/111401777>
This does not repro for me on WebKit ToT using the link. Would you be able to test it on iOS 17 beta?