Implement WebRTC using Kurento Media Server in Cordova

Posted By sumit kumar | 24-Jun-2016

Hi,

This blog is about how to implement WebRTC in android using kurento media server in cordova applications. Kurento is a WebRTC media server and a set of client APIs making simple the development of advanced video applications for WWW and smartphone platforms. Here is the steps to implement the WebRTC using KMS.

First create a cordova project and add android platfrom.

Next create a json file to install dependencies like this.

 

 

Next create a javascript file for server. You can get the javascript file from kurento documention. 

Install the bower components using command "sudo npm install -g bower".

After that install the dependencies using command "npm install". If you are having problem during installing any dependencies use command

rm -r node_modules

npm cache clean 

and install it again.

Next you need server certificate you can simply get it from kurento website.

You have to install kurento in your linux or ubuntu machine. You can install kurento media server on a remote machine if you are not using linux or ubuntu. To install use these commands :-

echo "deb http://ubuntu.kurento.org trusty kms6" | sudo tee /etc/apt/sources.list.d/kurento.list

wget -O - http://ubuntu.kurento.org/kurento.gpg.key | sudo apt-key add -

sudo apt-get update

sudo apt-get install kurento-media-server-6.0

To start and stop the kurento media server use these commands.

sudo service kurento-media-server-6.0 start

sudo service kurento-media-server-6.0 stop

In server file change the following lines.

var argv = minimist(process.argv.slice(2), {

  default: {

      as_uri: "https://localhost:8443/",  // address where your node application is running.

      ws_uri: "ws://localhost:8888/kurento" //address where your kurento media server is running.

  }

});

Next create a client side javascript file where all the client side interaction works. You can clone it from kurento documentation.

After that start your server using command "npm start". If your kurento media server is running on different machine then follow these steps.

Update your npm to version 2 using "sudo npm install npm -g".

After that use "npm start -- --ws_uri=ws://kms_host:kms_host:kms_port/kurento".

Make android build and run it.

 

THANKS

Request for Proposal

Recaptcha is required.

Sending message..