How to access camera on iOS11 home screen web app?

后端 未结 6 1753
遇见更好的自我
遇见更好的自我 2020-12-02 03:45

Summary

We cannot access camera from an iOS11 (public release) home screen web app using either WebRTC or the file input, details below. How can our users continu

6条回答
  •  长情又很酷
    2020-12-02 04:30

    Update: While some earlier published changelogs and postings led me to believe that Web Apps using a manifest.json instead of apple-mobile-web-app-capable would finally have access to a proper WebRTC implementation, unfortunately this is not true, as others here have pointed out and testing has confirmed. Sad face. Sorry for the inconveniences caused by this and let's hope that one lucky day in a galaxy far, far away Apple will finally give us camera access in views powered by (non-Safari) WebKit...

    Yes, as others have mentioned, getUserMedia is only available directly in Safari but neither in a UIWebView nor WKWebView, so unfortunately your only choices are

    • removing so your 'app' runs in a normal Safari tab, where getuserMedia is accessible
    • using a framework like Apache Cordova that grants you access to a device's camera in other ways.

    Here's to hoping Apple removes this WebRTC restriction rather sooner than later...

    Source:
    For developers that use WebKit in their apps, RTCPeerConnection and RTCDataChannel are available in any web view, but access to the camera and microphone is currently limited to Safari.

提交回复
热议问题