diff --git a/openvidu-insecure-angular/README.md b/openvidu-insecure-angular/README.md index 30c10dcc..30d8823d 100644 --- a/openvidu-insecure-angular/README.md +++ b/openvidu-insecure-angular/README.md @@ -1,88 +1,150 @@ # openvidu-insecure-angular -This repository contains a group videoconference sample application implemented using OpenVidu. This application is a SPA page implemented in [Angular 2](http://angular.io) and was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.17. +This is the Angular version of _openvidu-insecure-js_. Try it if you plan to use Angular framework for your frontend. -## Start OpenVidu Development Server +## Understanding this example -To develop a videoconference application with OpenVidu you first have to start an OpenVidu Development Server, that contains all needed services. OpenVidu Development Server is distributed in a single docker image. +

+ +

-To execute OpenVidu Development Server in your local development computer, you need to have docker software installed. You can [install it on Windows, Mac or Linux](https://docs.docker.com/engine/installation/). +OpenVidu is composed by the three modules displayed on the image above in its insecure version. -To start OpenVidu Development Server execute the following command (depending on your configuration it is is possible that you need to execute it with 'sudo'): +- **openvidu-browser**: NPM package for your Angular app. It allows you to manage your video-calls straight away from your clients +- **openvidu-server**: Java application that controls Kurento Media Server +- **Kurento Media Server**: server that handles low level operations of media flow transmissions -
-docker run -p 8443:8443 --rm -e KMS_STUN_IP=193.147.51.12 -e KMS_STUN_PORT=3478 openvidu/openvidu-server-kms
-
+> You will only have to make use of **openvidu-browser** NPM package to get this sample app working -And then wait to a log trace similar to this: +## Executing this example -
-INFO: Started OpenViduServer in 5.372 seconds (JVM running for 6.07)
-
+1. Clone the repo: -If you have installed Docker Toolbox in Windows or Mac, you need to know the IP address of your docker machine excuting the following command: + ```bash + git clone https://github.com/OpenVidu/openvidu-tutorials.git + ``` + +2. You will need angular-cli to serve the Angular frontend. You can install it with the following command: -
-docker-machine ip default
-
+ ```bash + npm install -g @angular/cli + ``` -Then, open in your browser and visit URL `https://127.0.0.1:8443` (or if you are using Docker Toolbox in Windows or Mac visit `https://:8443`). Then, browser will complain about insecure certificate. Please accept the selfsigned certificate as valid. +3. To run the sample application, execute the following command in the project: -Now you are ready to execute the sample application. + ```bash + cd openvidu-insecure-angular + npm install + ng serve + ``` -## Executing sample application +4. _openvidu-server_ and _Kurento Media Server_ must be up and running in your development machine. The easiest way is running this Docker container which wraps both of them (you will need [Docker CE](https://store.docker.com/search?type=edition&offering=community)): -In this repository you have a sample JavaScript application that use OpenVidu Development Server to allow videoconferences between a group of users. Please clone it with the following command (you need git installed in your development machine): + ```bash + docker run -p 8443:8443 --rm -e KMS_STUN_IP=193.147.51.12 -e KMS_STUN_PORT=3478 -e openvidu.security=false openvidu/openvidu-server-kms + ``` -
-git clone https://github.com/OpenVidu/openvidu-sample-basic-ng2
-
+5. Go to [`localhost:4200`](http://localhost:4200) to test the app once the server is running. The first time you use the docker container, an alert message will suggest you accept the self-signed certificate of _openvidu-server_ when you first try to join a video-call. -Then, install NPM dependencies with: +## Understanding the code -
-cd openvidu-sample-basic-ng2
-npm install
-
+This is an Angular project generated with angular-cli, and therefore you will see lots of configuration files and other stuff that doesn't really matter to us. After getting `openvidu-browser` NPM package (`npm install openvidu-browser`), we will focus on the following files under `src/app/` folder: -If you obtain an error executing this command, be sure you have installed Node 4 or highe together with NPM 3 or higher. +- `app.component.ts`: AppComponent, main component of the app. It contains the functionalities for joining a video-call and for handling the video-calls themselves. +- `app.component.html`: HTML for AppComponent. +- `app.component.css`: CSS for AppComponent. +- `stream.component.css`: StreamComponent, auxiliary component to manage Stream objects on our own. It wraps the final HTML `