npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ng2-opentok

v2.1.0

Published

## Description

Downloads

268

Readme

ng2-opentok

Description

This library is an angular 2 wrapper in typescript of opentok.js library(web). Full description of the opentok platform can be found here. This library is still in beta version, so any contribution is always welcome.

Documentation

The documentation for opentok.js can be found here and used as a reference when using this library.

Here is a wiki with description ONLY of the opentok service provided by in this library, to make the implementation of a simple video call between two users easier.

Use the opentok official documentation to learn how to implement the logic with the help of the models wrapped in this library, for custom use and for video call between multiple users. The wiki does not contain information about them, use the files with code as reference:

Basic models

Events

Errors

Installation

To install this library, run:

$ npm install ng2-opentok --save

Use

This library should be used as described in the official documentation for Opentok. This means you can follow their tutorials for creating a backend server, and use the new service and classes available in this library. The prerequirements stay the same though.

Prerequirements

To use this library you need to have:

  • A valid TokBox account — if you don't have one, you can sign up for a free trial
  • A webcam and microphone
  • Google Chrome, Firefox or another supported browser
  • A local web server — if you don't already have one, try setting up a SimpleHTTPServer using Python or http-server using Node.js.

Basic video chat tutorial from opentok

Authentication prerequirements

In order to use the library OpenTok, the client will need to have some authentication credentials — an API Key. The API key can be obtained from the valid TokBox Account.

Use the DEMO project and the ng2-opentok documentation to see how the library is used.

After you have read the basic tutorial and obtained an api key, you can add to your Angular AppModule:

    typescript
    import { BrowserModule } from '@angular/platform-browser';
    import { NgModule } from '@angular/core';
    import { AppComponent } from './app.component';

    // Import Opentok library
    import {OpentokModule} from "ng2-opentok/dist/opentok.module"

    @NgModule({
      declarations: [
        AppComponent
      ],
      imports: [
        BrowserModule,

        // Add you opentok module here with the api key for opentok
        OpentokModule.forRoot({apiKey: "your-api-key-here"})
      ],
      providers: [],
      bootstrap: [AppComponent]
    })
    export class AppModule { }
    

Once your library is imported, you have to add the actual opentok.js library and it's css file in the scripts section in your index.html.

You can also install OpenTok.js using the @opentok/client npm package.

    html
    <!doctype html>
    <html>
    <head>
      <meta charset="utf-8">
      <title>OpentokNg2Demo</title>
      <base href="/">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <link rel="icon" type="image/x-icon" href="favicon.ico">

      <!-- YOUR OPENTOK CSS AND JS go here -->
      <link rel='stylesheet' href='https://static.opentok.com/webrtc/v2.10.0/css/TB.min.css'>
      <script src='https://static.opentok.com/v2/js/opentok.min.js'></script>
      <!-- / YOUR OPENTOK CSS AND JS go here -->

    </head>
    <body>
      <app-root></app-root>
    </body>
    </html>
    

Development

To generate all *.js, *.d.ts and *.metadata.json files:

$ npm run build

To lint all *.ts files:

$ npm run lint

Contribution

If you have any problems with pull request and want to contribute, contact me

License

MIT © WF | Snezhana Dichevska

Developed by SnezanaDichevska