Socket
Socket
Sign inDemoInstall

angular-openvidu

Package Overview
Dependencies
14
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    angular-openvidu

Simple, robust, OpenVidu room videochat component for Angular


Version published
Weekly downloads
8
increased by60%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

angular-openvidu

Travis Dependency Status GitHub license

AngularOpenVidu is a room videoconference component library for Angular.

It's written in TypeScript, with the guidelines from Angular Components.

To be able to work in the browser, AngularOpenVidu uses openvidu-browser to communicate with the OpenVidu Server.

To use AngularOpenVidu, WebRTC support is required (Chrome, Firefox, Opera).

Table of contents

App Demo

In this demo you will see a use case of angular-openvidu, where you can test ALL the features included in this component.

Follow the instructions from the app's README to test it out.

Link to the repository: https://github.com/alxhotel/angular-openvidu-demo

Features

  • Join a group call
  • Close group call
  • Disable camera
  • Mute microphone
  • Toggle fullscreen video

Installation

  1. Install angular-openvidu node module through npm:

    $ npm install angular-openvidu --save
    
  2. Import OpenViduModule to your AppModule

    import { NgModule } from '@angular/core';
    import { FormsModule } from "@angular/forms";
    import { BrowserModule  } from '@angular/platform-browser';
    import { AppComponent } from './app.component';
    import { OpenViduModule } from 'angular-openvidu';
    
    @NgModule({
      imports: [BrowserModule, FormsModule, OpenViduModule],
      declarations: [AppComponent],
      bootstrap: [ AppComponent ]
    })
    export class AppModule { }
    

    You may also find it useful to view the demo source.

  3. Add hammer.js in your html:

    <script src="../node_modules/hammerjs/hammer.js"></script>
    
  4. Deploy OpenVidu Server

    You will need a OpenVidu Server.

    Follow the instructions in this page to deploy it with docker.

Usage

You are ready. Use it in your template:

<openvidu [wsUrl]="wsUrl" [sessionId]="sessionId" [participantId]="participantId">
	Loading openvidu...
</openvidu>
Propeties
NameTypeDescription
wsUrlString, requiredWebsocket URL pointing to your OpenVidu Server
sessionIdString, requiredAn id for a session
participantIdString, requiredAn id for the participant joining the session
Events

This events are coming from openvidu-browser, AngularOpenVidu uses them to implement the logic.

These are the events AngularOpenVidu exposes for the user of the module.

To use them just do:

<openvidu (eventName)="myEventHandler()">
	Loading openvidu...
</openvidu>
NameParamsDescription
onRoomConnectedNo paramstriggers when the client has established a session with the server
onRoomClosedNo paramstriggers when the room is closed
onLostConnectionNo paramstriggers when you can't establish a connection to the server
onParticipantJoined({participantId: participantId})triggers when a participant has joined your room
onParticipantLeft({participantId: participantId})triggers when a participant has left your room
onErrorMedia({error: error})triggers when an error occurs while trying to retrieve some media

Development

To compile, just run:

$ npm run build

Then, you will see the module compiled in the dist folder.

Things you need to know before contributing to this project:

1. Dependencies

These are the main modules that make up AngularOpenVidu:

ModuleVersionDescription
OpenVidu Browserused to communicate with the OpenVidu Server
Angular Materialused to display the toolbar, buttons and animations
Angular BigScreenused to toggle the fullscreen mode of the streaming
2. CSS

The CSS stylesheet is compiled from the LESS files with a custom gulp file

Troubleshooting

Why does it keep saying "Joining room..."?

This can be for 2 reasons:

  1. You may be having some trouble connecting to the OpenVidu Server's websocket.

    To make sure you are accepting its certificate go to:

    • [IP]: Openvidu Server IP
    • [PORT]: Openvidu Server port
    https://[IP]:[PORT]/room
    

    And make sure to accept its certificate. Then go back to the app and refresh the page.

  2. If you are accessing the app through a host different from localhost then you need to enable HTTPS.

    At least in Google Chrome, this is because: Any website which has integrated geolocation technology, screen-sharing, WebRTC and more, will now be required to be served from a secure (HTTPS) site.

    You could use ngrok to make an SSL tunnel to your computer. Or you could create a self-signed certificate, but don't use it in production.

    Create an SSL key:

    • [SSL_KEY_PATH]: your SSL key path
    • [SSL_CERT_PATH]: your SSL cert path
    $ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout "[SSL_KEY_PATH]" -out "[SSL_CERT_PATH]"
    

    To enable HTTPS just run angular-cli with this command:

    $ ng serve --ssl true --ssl-key "[SSL_KEY_PATH]" --ssl-cert "[SSL_CERT_PATH]" --host=0.0.0.0
    

    Since you are not using localhost, you need host=0.0.0.0 to listen for all IPs; you can change it to listen only for the IPs needed.

Got more questions?

Open an issue on the AngularOpenVidu issue tracker.

License

Apache Software License 2.0 ©

Keywords

FAQs

Last updated on 23 May 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc