Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does webKit in iOS 11 (Beta) support WebRTC?

I have a URL that is working fine with Safari on iOS11 (Beta) Audio/Video is working fine. But when I load this URL with WKWebView it gives me an error "Incompatible Browser" and when I check my browser version in WebKit it shows "WebKit based browser on iOS 11"

So the question really is, has Apple included this change in the WKWebview webkit (which should be the same as Safari) for the developer BETA of iOS 11?

like image 956
adarshk Avatar asked Jul 12 '17 10:07

adarshk


People also ask

Is WebRTC supported on iOS?

iOS. Unfortunately, WebRTC is not supported on iOS now. Although WebRTC works well on Mac when using Firefox, Opera, or Chrome, it is not supported on iOS. Nowadays, your WebRTC application won't work on Apple mobile devices out of the box.

Does iOS Safari support WebRTC?

WebRTC iOS Safari supportiOS Safari has been supporting WebRTC since Safari 11.

Does iOS Webview support WebRTC?

I was pumped and commented then that we were just waiting for the WKWebView domino to fall. 🤞🏻 Well, the time has come. In iOS 14.3, WKWebView now supports WebRTC and with the exception of those users who haven't upgraded to 14.3, you should be able to use it confidently.

Does WebKit work on iOS?

web browser engine. WebKit is the web browser engine used by Safari, Mail, App Store, and many other apps on macOS, iOS, and Linux. Get started contributing code, or reporting bugs.


3 Answers

Update: WebRTC Support is coming in iOS14.3 (Beta) 🎉

Learn more here: https://webkit.org/blog/11353/mediarecorder-api/

From iOS11+ :

WebRTC is partially supported in WKWebView,
and fully supported in the Safari App browser.


Explained:

WebRTC has three main JavaScript APIs:

  • MediaStream (aka getUserMedia)
  • RTCPeerConnection
  • RTCDataChannel

For apps running inside Safari App, iOS11+, all WebRTC APIs are supported. That includes getUserMedia. Be sure to use adapter.js library for best compatibility, since each browser - including Safari - uses a different name for its implementation. For example, in Safari it's navigator.mediaDevices.getUserMedia().

But, when using WKWebView or SFSafariViewController, it's a different story:

  • Both RTCPeerConnection and RTCDataChannel are supported and working.
  • getUserMedia is not supported yet, for "security reasons". It most probably won't be available before the next major OS release, which would be iOS 12 in September 2018.

You can still stream video & audio from local storage or consume live media captured by a peer. Hopefully in iOS 12 we'll see some progress...

like image 174
zaxy78 Avatar answered Sep 21 '22 15:09

zaxy78


I did a bit of digging in the WebKit sources last night, and it looks like the WebRTC/MediaCapture stuff is all gated behind a preference that's only accessible via a private API. There was also a commit that mentioned something about apps needing to handle all the setup for A/V permissions.

In any case, the result is that getUserMedia doesn't work in WKWebView, even on iOS11 (beta 4, at least) :(

I've filed a radar (rdar://33571214 and http://www.openradar.me/33571214) and encourage everyone else to do the same.

like image 33
dpogue Avatar answered Sep 21 '22 15:09

dpogue


I have done some tests with iOS Beta 4 and it seems that even WKWebview nor UIWebview don't support getUserMedia as a WebRTC API.

Can someone confirm this?

like image 33
Daniel Toplak Avatar answered Sep 25 '22 15:09

Daniel Toplak