iOS 11(测试版)中的webKit是否支持WebRTC? [英] Does webKit in iOS 11 (Beta) support WebRTC?
问题描述
我有一个与iOS11(测试版)上的Safari兼容的URL.音频/视频正常运行. 但是,当我用WKWebView加载此URL时,它给我一个错误不兼容的浏览器",当我在WebKit中检查我的浏览器版本时,它显示"iOS 11上基于WebKit的浏览器"
真正的问题是,苹果是否已为iOS 11开发人员BETA在WKWebview Webkit(应该与Safari相同)中包含此更改?
自iOS11起,
在 Safari App 浏览器中的 WKWebView ,和完全受支持的中部分支持 WebRTC.
说明:
WebRTC具有三个主要的JavaScript API:
- MediaStream(又名getUserMedia)
- RTCPeerConnection
- RTCDataChannel
对于在 Safari应用 iOS11 +中运行的应用,支持所有WebRTC API.其中包括getUserMedia
.确保使用 adapter.js 库以获得最佳兼容性,因为每个浏览器(包括Safari)都使用不同的名称来实现.例如,在Safari中为navigator.mediaDevices.getUserMedia()
.
但是,当使用 WKWebView 或 SFSafariViewController 时,情况就不同了:
-
RTCPeerConnection
和RTCDataChannel
均受支持并正常工作.
出于安全原因", -
getUserMedia
已 不受支持. .它很可能在下一个主要操作系统版本之前将不可用,即2018年9月的iOS12.
您仍然可以流式传输视频&来自本地存储的音频或使用对等方捕获的实时媒体.希望在iOS 12中我们能看到一些进步...
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?
Since 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
andRTCDataChannel
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...
这篇关于iOS 11(测试版)中的webKit是否支持WebRTC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!