4

i need to stream a video over webrtc & play it on web page, it works properly on all desktop browser window & mac os. it works on android browsers too. but on safari iOS the video is rotated as landscape. it's rotated on both ( when capturig the video with iOS safari and when receiving the stream on chrome or safari desktop). I tested it with the default basic getUserMedia example demo on webrtc site with safari iOS ans its the same issue. how can fix it or if any other solution please ?

1 Answers1

2

Something that may be relevant that I've come across -

Requesting { width: 640, height: 480 } on iOS in portrait mode will return a camera MediaStream which is { width: 480, height: 640 }, and on orientation change the MediaStream flips its dimensions. Be careful around hardcoding the html elements width and height. Can cause warping. People should stick to known resolutions e.g those listed in en.wikipedia.org/wiki/Display_resolution. When you use an atypical resolution WebRTC spec states the browser will try emulate your desired feed. However this makes poor cross-browser code. If you want a consistent camera feed I would avoid this.

source: getUserMedia (Selfie) Full Screen on Mobile

Ced
  • 1,117
  • 1
  • 8
  • 16