WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
212733
[iOS] applyConstraints should take into account rotation when computing width and height for video tracks
https://bugs.webkit.org/show_bug.cgi?id=212733
Summary
[iOS] applyConstraints should take into account rotation when computing width...
youenn fablet
Reported
2020-06-04 02:05:59 PDT
[iOS] applyConstraints should take into account rotation when computing width and height for video tracks
Attachments
Add attachment
proposed patch, testcase, etc.
milen
Comment 1
2021-08-05 09:02:18 PDT
This issue causes applyConstraints() to be not usable at all in our case. The case is: 1) Get HD video. 2) Show preview. 3) Later switch to SD video. Tested on iPhone SE with iOS 14.7.1 in portrait orientation. In landscape orientation the case works fine. The result is: The HD video preview is good. (the preview is in portrait orientation) The SD video preview is cropped. (the preview is in landscape orientation even the phone is in portrait) This is the code to reproduce the issue: ----- let constraintsHD = { width: {ideal: 1280}, height: {ideal: 720}, }; let constraintsSD = { width: {ideal: 640}, height: {ideal: 360}, }; navigator.mediaDevices.getUserMedia({video: constraintsHD, audio: false}) .then(stream => { setTimeout(() => { let videoTrack = stream.getVideoTracks()[0]; console.log("SETTINGS HD: ", videoTrack.getSettings()); }, 1000); setTimeout(() => { let videoTrack = stream.getVideoTracks()[0]; videoTrack.applyConstraints(constraintsSD).then(() => { let settings = videoTrack.getSettings(); console.log("SETTINGS SD: ", videoTrack.getSettings()); }) }, 3000); }); ----- It logs: Settings HD: height: 1280, width: 720 Settings SD: height: 360, width: 640 As a workaround we don't use applyConstraints() and always use SD video on iOS. The same case works fine in Chrome/Android.
Davy De Durpel
Comment 2
2021-11-05 02:54:48 PDT
I'm facing the same issue. In our case we want to reduce the size of the video when we move it in PiP. This allows us to reduce lots of bandwidth and as such reduce our carbon footprint to save mother planet :-)
Levi Li
Comment 3
2022-12-30 22:09:40 PST
I'm facing the same issue too
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