NOTE: This project is not being actively maintained and it may not work with the latest version of the cordova-plugin-iosrtc or the latest server side code of the Google's AppRTC.
Google's AppRTC adapted to Cordova iOS with pure HTML5/JavaScript and cordova-plugin-iosrtc.
This project takes the HTML5 version of the AppRTC application and runs it in Cordova iOS (iPhone, iPad...) by using the cordova-plugin-iosrtc to provide the WebRTC W3C JavaScript APIs.
- Get the source code:
$ git clone https://github.com/eface2face/iOSRTCApp
$ cd iOSRTCApp
- Install NPM dependencies:
$ npm install
- Add both platforms. All the needed plugins are installed automatically because of being included in the "config.xml" file:
$ cordova platform add ios android
- Run as usual:
$ cordova run android --device
$ cordova run ios --device
- Once running, enter the same room as one already created via web browser at https://apprtc.appspot.com/, and enjoy!
There are minor changes in the original HTML, JavaScript and CSS in order to make it work as a Cordova application. Those changes are:
js/apprtc.debug.js
andjs/appwindow.js
are loaded once Cordova'sondeviceready
event is fired. This is needed sincejs/apprtc.debug.js
relies on existingwindow.webkitRTCPeerConnection
andnavigator.webkitGetUserMedia
which are not set by the cordova-plugin-iosrtc untilondeviceready
fires.webrtcDetectedVersion
global variable is hardcoded to43
(AppRTC JavaScript code expects browser to be Chrome or Chromium, and fails otherwise).- In order to correctly place video views (iOS native
UIView
elements) the pluginrefreshVideos()
function is called when the local or remote video is set (this is because the CSS video elements use "transition" effects that modify their position and size during 1 second). - A new CSS file
css/main_overrides.css
changes the properties of video elements. For example, it setsopacity: 0.85
in#local-video
and#remote-video
so HTML call controls are shown even below the nativeUIView
elements rendering the local and remote video.
AppRTC code is owned by Google as stated in the original LICENSE file.
Changes to the original AppRTC HTML5 source code (to become a Cordova iOS application) are written by Iñaki Baz Castillo at eFace2Face, inc.