Developing OpenVidu

This documentation is suitable for Ubuntu 14.04 or Ubuntu 16.04. Packages required:

Dependecy Check version Install
java 8 JDK java -version sudo apt-get install -y default-jdk
node node -v sudo curl -sL https://deb.nodesource.com/setup_6.x | sudo bash -
sudo apt-get install -y nodejs
maven mvn -v sudo apt-get install -y maven
angular-cli ng -v sudo npm install -g @angular/cli

Setup for development

Here we show how to develop an Angular app (openvidu-testapp) with openvidu-browser and openvidu-server as local dependencies, waiting to be modified as you want.

1) Install KMS

2) Clone repo:

git clone https://github.com/OpenVidu/openvidu.git

3) openvidu/openvidu-browser/

npm install
npm run build
sudo npm link

4) openvidu/

mvn -DskipTests=true compile && mvn -DskipTests=true install

5) openvidu/openvidu-testapp/

npm install
npm link openvidu-browser
ng serve

6) Start KMS in your machine:

sudo service kurento-media-server restart

8) openvidu/openvidu-server/

mvn exec:java

(or if you prefer you can just run the Java application in your favourite IDE)


At these point, you can start modifying openvidu-ng-testapp, openvidu-browser or openvidu-server.

  • openvidu-testapp : the previous "ng serve" command will take care of refreshing the browser's page whenever any change takes place.

  • openvidu-browser : after modifying any typescript file, you will need to run the following command to update your changes:

    /openvidu/openvidu-browser

    npm run build

  • openvidu-server : after modifying any file, there is no other alternative but to re-launch the java application if you want to update your changes.

    /openvidu/openvidu-server

    mvn clean exec:java

    (or re-launch the Java application in your IDE. Some IDE's support automatic re-launch in response to changes)


Setup for advanced development: share the app through your network

You can also use different machines in the same network to build a more advanced development environment, so you can test the application in different devices at the same time. It's very similar to the process outlined above:

You will need a server for the built app (if you don't have any, we recommend http-server): npm install -g http-server

Run exactly the same commands as the process above, but on step 6) skip ng serve. We don't want Angular-CLI to serve our app. Instead, these commands will be the ones which you should launch (and relaunch to update your changes):

openvidu/openvidu-testapp/

ng build -op ./dist
cd dist
openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -subj '/CN=www.mydom.com/O=My Company LTD./C=US' -keyout key.pem -out cert.pem
http-server -S

This builds the Angular project, generate a self-signed certificate (which unfortunately is a mandatory requirement for http-server SSL) and serves the content with http-server.

Finally, to launch the app connect to https://localhost:8080 in the machine running the http-server and to https://[HOST]:8080 in other devices of the same network ([HOST] being the IP of the machine running the http-server).


Installing KMS

How to install and run KMS in your development machine:

Ubuntu 14.04 LTS Trusty (64 bits)

echo "deb http://ubuntu.openvidu.io/6.7.0 trusty kms6" | tee /etc/apt/sources.list.d/kurento.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5AFA7A83
apt-get update
apt-get -y install kurento-media-server
apt-get -y install openh264-gst-plugins-bad-1.5

Ubuntu 16.04 LTS Xenial (64 bits)

echo "deb http://ubuntu.openvidu.io/6.7.0 xenial kms6" | tee /etc/apt/sources.list.d/kurento.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5AFA7A83
apt-get update
apt-get -y install kurento-media-server
apt-get -y install openh264-gst-plugins-bad-1.5

Start and stop the service

sudo service kurento-media-server start
sudo service kurento-media-server stop

Here you can check Kurento's official documentation.