[Webkit-unassigned] [Bug 258312] New: getUserMedia produces different results for the same constraints
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jun 20 11:14:00 PDT 2023
https://bugs.webkit.org/show_bug.cgi?id=258312
Bug ID: 258312
Summary: getUserMedia produces different results for the same
constraints
Product: WebKit
Version: Safari 16
Hardware: iPhone / iPad
OS: iOS 16
Status: NEW
Severity: Major
Priority: P2
Component: WebRTC
Assignee: webkit-unassigned at lists.webkit.org
Reporter: burzomirdev at gmail.com
CC: youennf at gmail.com
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
}
```
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230620/935fb068/attachment.htm>
More information about the webkit-unassigned
mailing list