javascript 使用 webRTC 在 iOS 浏览器和 Android Chrome 中进行跨平台视频聊天的 WebApp

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23374806/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-28 00:47:03  来源:igfitidea点击:

WebApp using webRTC for cross-platform videochat in iOS Browser and Android Chrome

javascriptandroidiossafariwebrtc

提问by user2330237

We are trying to build a webapp for videochat that will run in a browser across platforms (desktop, iOS, Android).

我们正在尝试构建一个用于视频聊天的网络应用程序,该应用程序将在跨平台(桌面、iOS、Android)的浏览器中运行。

At this time we are not aware of how to run webRTC in a browser on iOS -- it only runs in several desktop browsers and chrome for Android (e.g. peerjs).

目前我们不知道如何在 iOS 上的浏览​​器中运行 webRTC——它只能在几个桌面浏览器和 Android 的 chrome(例如 peerjs)中运行。

Are there tools to get webRTC to run in a browser on iOS? Are there tools already built to create a webapp that runs webRTC on iOS by using a hybrid app approach (tools specifically for the hybrid iOS app, not just a webRTC SDK for iOS)?

是否有工具可以让 webRTC 在 iOS 的浏览器中运行?是否已经构建了使用混合应用程序方法(专门用于混合 iOS 应用程序的工具,而不仅仅是适用于 iOS 的 webRTC SDK)来创建在 iOS 上运行 webRTC 的 web 应用程序的工具?

When webRTC will be supported by Safari or Chrome on iOS?

iOS 上的 Safari 或 Chrome 何时支持 webRTC?

回答by Dr. Alex Gouaillard

  • [update February 2017] - It looks like webrtc arrival in the apple world is imminent. All the code is here and the integration in progress. Expect some part of the API for H1 2017.
  • Apple policy forces other browser to use their version of webkit which does not support webRTC, so you will not have webRTC support in a web app on iOS anytime soon. Activity in webkit hints as a change, but time for this to land, it will be months.
  • webRTC is only an API but in its open source implementation (webrtc.org) you also have a full application (appRTC) with the infrastructure, a web client, android client and iOS client. The last two are called "appRTCDemo". The feature of the iOS one are not yet at parity with the web client and android client, but it's getting There. Disclaimer: I belong to one of the company that contribute the open source code, especially the iOS part.
  • There are lots of SDK out there that can help you with cross platform / os / browser support. Some are flash based (add live), some are proprietary and suppose that you use their infrastructure (tokbox), some are free without movie support (peerjs), some are free for the web client and the infrastructure, but you have to pay for the movie SDK (easyRTC). I guess all of those could due of interest to you. You can see a non exhaustive list of webRTC vendors here and query it depending on what you want: http://webrtchacks.com/vendor-directory/
  • [2017 年 2 月更新] - 看来 webrtc 即将进入苹果世界。所有代码都在这里,集成正在进行中。预计 2017 年上半年 API 的某些部分。
  • Apple 政策强制其他浏览器使用不支持 webRTC 的 webkit 版本,因此您很快将无法在 iOS 上的网络应用程序中获得 webRTC 支持。webkit 中的 Activity 暗示了一个变化,但要让它落地,需要几个月的时间。
  • webRTC 只是一个 API,但在其开源实现 (webrtc.org) 中,您还有一个完整的应用程序 (appRTC),其中包含基础设施、Web 客户端、Android 客户端和 iOS 客户端。最后两个称为“appRTCDemo”。iOS 版的功能尚未与 Web 客户端和 android 客户端相提并论,但它正在实现。免责声明:我属于贡献开源代码的公司之一,尤其是 iOS 部分。
  • 有很多 SDK 可以帮助您跨平台/操作系统/浏览器支持。有些是基于 flash(实时添加),有些是专有的,假设你使用他们的基础设施(tokbox),有些是免费的,没有电影支持(peerjs),有些是免费的 Web 客户端和基础设施,但你必须付费电影 SDK (easyRTC)。我想所有这些都可能引起您的兴趣。您可以在此处查看 webRTC 供应商的非详尽列表,并根据需要进行查询:http://webrtchacks.com/vendor-directory/

回答by Timotheus.Kampik

There are frameworks like easyrtctheoretically allowing developers to write webRTC apps without needing to worry about browser-specific issues. However, webRTC is quite new and not completely stable, yet. As far as I know, webRTC does not work reliably for Chrome for iOS and not at all for Safari.

有像easyrtc这样的框架理论上允许开发人员编写webRTC应用程序而无需担心特定于浏览器的问题。然而,webRTC 是相当新的并且还不是完全稳定的。据我所知, webRTC 对于 iOS 的 Chrome 不能可靠地工作,而对于 Safari 则根本不能

回答by Pierre F

Update as of June 2017: WebRTC and getUserMedia are available in WebKit since iOS 11.

2017 年 6 月更新:WebRTC 和 getUserMedia 自 iOS 11 起在 WebKit 中可用。

See also: Release notes from Safari 11.0

另请参阅:Safari 11.0 的发行说明

New in Safari 11.0 – Support for real-time communication using WebRTC.

New in Safari 11.0 – Camera and microphone access. Added support for the Media Capture API. Added ability for websites to access camera and microphone streams from a user's device (user permission is required.)

Safari 11.0 中的新功能 – 支持使用 WebRTC 进行实时通信。

Safari 11.0 中的新功能 – 摄像头和麦克风访问。添加了对媒体捕获 API 的支持。添加了网站从用户设备访问摄像头和麦克风流的功能(需要用户许可。)