4

I have been developing a web application that uses getUserMedia to access the user's video camera stream to take photos. For this purpose I want to get the camera's maximum resolution or at least something fairly high. This works fine on Windows, Linux, Android (Chrome and Firefox respectively).

However, on iOS Safari (iOS 11.4.1, Safari 11.0) it always just gives me 1280x720 pixels at most. Of course this is not the maximum of my Iphone 6 Plus' camera.

This command lets me reproduce my issue easily via the JS console by requesting the stream and logging its settings shortly after:

navigator.mediaDevices
  .getUserMedia({video:{width:8000,height:8000, facingMode:'environment'}})
  .then(stream => setTimeout(()=>console.log(stream.getVideoTracks()[0].getSettings()),500))
  .catch(console.error)

The unrealistically high "ideal" constraints for width and height cause the other browsers on Android etc to return the respective camera's maximum resolution. Not so for iOS Safari.

Has anyone managed to get higher resolutions via getUserMedia on mobile Safari?

Thank you!

Bakkenrak
  • 123
  • 1
  • 11

0 Answers0