Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Webrtc in Native App

My questions is :

1 -- Is it possible to have a WebView( Provided by Native framework) instance in my Native App , and extend it to support Webrtc,

if 1 is Yes, then probably following would be the action Item

1 -- Have a webrtc build on Android, 2 -- In Android WebView extend Javascript to couple / bind the Webrtc call,

Please confirm..

What i am trying to do is

1 -- We have webrtc based Voice / Video chat application working fine in Chrome & Mozilla desktop Browser, as both comes with webrtc... , i.e. user need to access www.xyz.com and it will start video / voice sessions,

2 -- same thing on mobile, we would like to go as a native app, i.e. we are trying to make an application, which will have native WebView instance, in which we will access www.xyz.com to have voice / video session

3 -- I tried the way i explained in 2 but it seems, in WebView instance provided by Application framework doesn't have webrtc enabled in it, so i am trying to add it and this is what i am thinking,

-- WebView instance has some mechanism to extend the Javascript , that means http://dev.w3.org/2011/webrtc/editor/webrtc.html some of these API i need to add into the WebView, and for their implementation will come if i am able to successfully integrate and build Webrtc over android and iOS Platform

Please comment....

like image 224
Amitg2k12 Avatar asked Jun 05 '13 07:06

Amitg2k12


6 Answers

If you want to use webRTC in a Native App, i've built a small android app (https://github.com/pchab/AndroidRTC) that share the back camera to a nodeJS server (https://github.com/pchab/ProjectRTC). I found that the easiest way to use the libjingle library is with IntelliJ IDEA. I've had a lot of problems with Eclipse and Android Studio.

like image 89
user2570177 Avatar answered Oct 13 '22 00:10

user2570177


You're going to have a hard time with the WebView, although it's coming on (newer) Android at least. Nothing on the horizon for iOS.

If you want complete native, you can check out what we've done @ FM with IceLink, sounds like it might work for you.

like image 29
jvenema Avatar answered Oct 12 '22 23:10

jvenema


Android WebView does not support WebRTC APIs at this point.

Work is underway on Java an Objective-C bindings, though that may not solve your problem.

like image 43
Sam Dutton Avatar answered Oct 12 '22 22:10

Sam Dutton


With Android L release this should be possible by using just the Android WebView, more below : http://developer.android.com/about/versions/android-5.0.html#WebView

like image 43
Schleir Avatar answered Oct 12 '22 22:10

Schleir


I know this question is kinda old, but I find crosswalk (https://crosswalk-project.org/) to be a pretty good solution for using WebRTC inside of an Android app. What crosswalk do, is compiling a chromium browser into an Android app and hosting your site inside of this chromium, so you will have support for the latest browser features, like WebRTC.

like image 20
Kevkong Avatar answered Oct 12 '22 22:10

Kevkong


I'm building a native app with a webview and webrtc video inside. So generally it is possible to build such application and nowadays chromium (webview) have a official support https://developer.chrome.com/multidevice/webview/overview , but I have faced really a lot of problem during writing that application.

Few problems are:

  • Support for phones and os version - I have android 5.1.1 (xperia m2) and after a lot of problems webrtc is running. On android 6 (xperia z5 compact) is not working.. On other phones is sometimes working sometimes not...
  • You can not be sure, how webview will work - today webrtc is working, but tommorow Google can add some security rule, and it will not work- it's a little bit unstable, and as I have seen, some things depend on os compilation. WebView can get update from store independently of os.
  • PERMISSIONS - there are a lot of stupid problems, based on the fact that is it a browser inside native app, like - you can't expect a permission question from webview, you have to implement it in android webview config, and in some android versions it is working- in others not :-)
  • Still a lot of problems of 'young product' - example is that nowadays webview has some issue with devices info display (like camera is front or back) so you have to find a workaround for such problem
  • Bad video quality - currently my problem is a quality of video- nice quality of video on phone, below maximum resources consumed (cpu, network, memory) and video on computer is really poor...
  • ...and many more

So the fact is - yes this is possible, but it's still not good enough to use it without facing a lot of problems which are not so easy to solve.

like image 37
Krystian Avatar answered Oct 12 '22 22:10

Krystian