Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using webrtc code on my cordova app

Im trying to use webRTC API such as getUserMedia and RTCPeerConnection for my app which is built with the cordova framework.

I am wondering if its possible for webRTC to work on both Android and iOS since my video chat app is a hybrid app (js and html) which is supposed to manage the entire p2p video chat by itself, unlike pc versions which require a web browser for the webRTC communication.

like image 318
Niko Vincent Avatar asked Mar 03 '18 18:03

Niko Vincent


1 Answers

Yes, It is possible to get them to work. Keep in mind, the architecture of cordova application is reliant on a Web View rendering of your application. That web view will need to provide the WebRTC APIs to consume in JavaScript. This thread suggest the web view in iOS 11 does not support it. In fact, it is pretty new to Safari all together. This documentation says that the latest versions of Android Web Views do have support. WebRTC is a collection of technologies that enables RTC, and there are native libraries for accomplishing this. I have seen a couple of plugins for Cordova that enable access to native code so you are not as reliant on the Web View.

cordova-plugin-iosrtc

phonertc

Good luck!

like image 169
William Fleming Avatar answered Oct 16 '22 14:10

William Fleming