Android 上的 WebRTC
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22085239/
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
WebRTC on Android
提问by whitebear
I would like to use WebRTC on Titanium. In the end of last year, WebRTC was implemented on Chrome for Android. I would like to make an application with WebRTC on Android.
我想在 Titanium 上使用 WebRTC。去年年底,WebRTC 在 Android 版 Chrome 上实现。我想在 Android 上使用 WebRTC 制作一个应用程序。
I have a few questions:
我有几个问题:
- Is it possible to use WebRTC on native webview or it is only for chrome?
- What is the simplest way to implement webRTC on Android?
- 是否可以在本机 webview 上使用 WebRTC 或仅适用于 chrome?
- 在 Android 上实现 webRTC 的最简单方法是什么?
I have found the old article about webRTC on mobile here WebRTC on a standalone mobile appbut it is old, how has the situation changed now?
我在独立移动应用程序上的 WebRTC 上找到了关于移动设备上的webRTC 的旧文章,但它已经过时了,现在情况发生了怎样的变化?
回答by GleasonK
Just an update on WebRTC for those seeing this post later:
对于那些稍后看到这篇文章的人来说,只是一个关于 WebRTC 的更新:
WebRTC Library
WebRTC 库
If you are only catering to Android L (5.0), you can use the updated WebView. I am not sure you can support older Android versions with a WebView though. You can take the native option of course.
如果您只为 Android L (5.0) 提供服务,您可以使用更新的 WebView。我不确定您是否可以使用 WebView 支持旧的 Android 版本。您当然可以选择本机选项。
As other users mentioned, compiling WebRTC source files is certainly a viable option if you have the time and resources. However, if you would like to get up and running faster, Pristine.iois dedicated to hosting up to date WebRTC Android artifacts. To begin using WebRTC natively on your Android, you can add the following to your app's build.gradle
:
正如其他用户所提到的,如果您有时间和资源,编译 WebRTC 源文件当然是一个可行的选择。但是,如果您想更快地启动和运行,Pristine.io致力于托管最新的 WebRTC Android 工件。要开始在您的 Android 上本地使用 WebRTC,您可以将以下内容添加到您的应用程序的build.gradle
:
dependencies {
...
compile 'io.pristine:libjingle:9694@aar'
}
At the time I am writing this, I have been working with WebRTC on Android for the past few months, and the most recent revision I have been using is 9694. Find the most recent revision here.
在我写这篇文章的时候,过去几个月我一直在使用 Android 上的 WebRTC,我使用的最新版本是 9694。在这里找到最新版本。
Getting Started on Android
开始使用 Android
As with WebRTC's javascript library, you will need a service to take care of user discovery and SDP signaling. I built a WebRTC Signaling APIusing PubNubfor the signaling service. You can include it and begin to use it right away by adding the following to your app's build.gradle
:
与 WebRTC 的 javascript 库一样,您需要一个服务来处理用户发现和 SDP 信号。我使用PubNub为信令服务构建了一个WebRTC 信令 API。您可以通过将以下内容添加到您的应用程序中来包含它并立即开始使用它:build.gradle
dependencies {
...
compile 'io.pristine:libjingle:9694@aar'
compile 'me.kevingleason:pnwebrtc:1.0.6@aar'
compile 'com.pubnub:pubnub-android:3.7.4' //optional
}
Additional Resources
其他资源
回答by Ichigo Kurosaki
Check this link, it is sample android application provided for apprtc demo of webrtc. Follow the instructions on this link, you will get android application which you can test on two android devices, also on android to web apprtc demo works fine. Following the source code you may get some clue for developing your own android application for android.
检查此链接,它是为 webrtc 的 apprtc 演示提供的示例 android 应用程序。按照此链接上的说明,您将获得可以在两个 android 设备上测试的 android 应用程序,也可以在 android 到 web apprtc 演示上正常工作。按照源代码,您可能会获得一些有关为 android 开发自己的 android 应用程序的线索。
Note:The link provided in this example for gclient config command is older one. Follow this link
注意:此示例中为 gclient config 命令提供的链接是旧链接。按照这个链接
gclient config http://webrtc.googlecode.com/svn/trunk
gclient 配置http://webrtc.googlecode.com/svn/trunk
Good luck.
祝你好运。
回答by Murugan Pandian
Yes, it's possible in Android using crosswalk. Please refer to this https://crosswalk-project.org/
是的,在 Android 中可以使用人行横道。请参考这个 https://crosswalk-project.org/