Post

Replies

Boosts

Views

Activity

WebRTC `getUserMedia` api return stream swapped height and width randomly
Environment: iPhone 13/14, iOS 16, Chrome, Safari Description: We use WebRTC api to stream camera to <video>. We did some business logics according to stream's width and height. But the height and width value swapped randomly. Expected result: video stream height is always larger than width on portrait mode. Actual result: video stream width height swapped randomly. How to reproduce: 1.Visit on mobile https://yari-demos.prod.mdn.mozit.cloud/en-US/docs/Web/API/Media_Capture_and_Streams_API/Constraints/_sample_.Example_Constraint_exerciser.html Click start button above "Requested video constraints:" See the outputs in "Actual video settings": "height" is larger than "width" in portrait mode Repeat clicking start button and see the outputs multiple times. You can see "height" will be smaller than "width"
2
1
1.4k
Oct ’22