Here we explain how to run origin VideoChat code sample for browser on Cordova/PhoneGap environment
Complete Video Chat API integration guide for Web/Javascript and Hybrid apps is here
Integration details
- Make sure you have the latest Cordova installed:
The output will be something like this:
If Cordova is not installed - run the following command:
- Create Cordova app:
You can use the Create your first Cordova app guide to get more info how to create your 1st Cordova app.
- Change directory to newly created Cordova app:
- Add platforms:
- Install cordova-plugin-device plugin:
- Install cordova-custom-config plugin
- Install cordova-plugin-statusbar plugin
Then add the following lines into config.xml (for iOS 10+):
And the following for Android:
Also, don’t forget to put the xmlns:android="http://schemas.android.com/apk/res/android"
attribute in the root widget
element.
More info on Android permissions.
- Install cordova-plugin-android-permissions plugin
- move to WKWebView for iOS
Then to setup the required permissions:
More info on permissions https://github.com/apache/cordova-plugin-wkwebview-engine#required-permissions
- Install cordova-plugin-iosrtc plugin to make video calling work at iOS:
Then follow all the steps from the Building Steps guide to connect the plugin in a right way.
-
Install iOS Deployment Tools if you want to launch iOS app on iOS device.
-
Take sources from https://github.com/ConnectyCube/connectycube-web-samples/tree/master/videochat to your connectycube-cordova-samples/sample-videochat-cordova app:
- clone connectycube-web-samples repository;
- navigate to the connectycube-web-samples/videochat and run
npm install && npm run build
to prepare dist;
- copy dist’s content to the connectycube-cordova-samples/sample-videochat-cordova/www folder of your Cordova app
- Create and add index.js file into www folder:
- Change
<meta name="viewport" content="..." />
and connect cordova.js
, index.js
scripts instead of main.js
at your index.html
file:
- Finally, use the following commands to run the sample:
The complete sample source code is available at GitHub repository
Debugging
The following tools will help you debug your Cordova application:
Can’t build yourself?
Got troubles with building Cordova code sample? Just create an issue at Issues page - we will create the sample for you. For FREE!