Giter Club home page Giter Club logo

opentok-ionic-samples's Introduction

OpenTok Labs

OpenTok Ionic Samples

In this repo, you'll find the following sample applications:

  • Basic Video Chat
    • This sample application shows how to connect to an OpenTok session, publish a stream, and subscribe to a single stream in an iOS and Android application.

Prerequisites:

  1. Node.js

  2. Ionic: $ npm install -g ionic

  3. Xcode

  4. Android Studio

Note: Please make sure to run the commands in the same order as below
  1. Clone this repo

  2. Change directory to the sample project

  3. Run: $ npm install

  4. Add the Cordova-OpenTok-Plugin: $ ionic cordova plugin add https://github.com/msach22/cordova-plugin-opentok/

Configuring the application

Before running the application, you need to configure it to use the API key for your OpenTok project, along with an OpenTok session ID and token. For test purposes, you can get a test session ID and token for your project at your TokBox account page.

Open the src/pages/home/home.ts file in your project and set the apiKey, sessionId, and token values to the API key, session ID, and token:

    // Set Credentials
    this.apiKey = '';    // Add your API key.
    this.sessionId = ''; // Add the session ID.
    this.token = '';     // Add the token.

An OpenTok session connects different clients letting them share audio-video streams and send messages. Clients in the same session can include iOS, Android, and web browsers.

For testing, you can use a session ID and token generated at your TokBox account page. However, the final application should obtain these values using the OpenTok server SDKs. For more information, see the OpenTok developer guides on session creation and token creation.

Running the application

For Android

  1. In the root directory of the sample project, run ionic serve.
    • This is needed to copy over the files to the www folder
  2. Next, run ionic cordova prepare android.
  3. Open Android Studio.
  4. Click Open an existing Android Studio project.
  5. Navigate to the platforms/android subdirectory of this project and select the build.gradle file.
  6. Click run.
Note: If you're using the simulator, you will see a black container for your publisher since the simulator doesn't have a camera.

For iOS

  1. In the root directory of the sample project, run ionic serve.
    • This is needed to copy over the files to the www folder
  2. Next, run ionic cordova prepare android.
  3. Open Xcode.
  4. Click Open another project...
  5. Navigate to the platforms/ios subdirectory of this project and select MyApp.xcodeproj.
  6. Sign the project.
  7. Run.
Note: If you're using the simulator, you will see a simulation for your publisher since the simulator doesn't have a camera.

opentok-ionic-samples's People

Contributors

msach22 avatar

Watchers

 avatar  avatar

opentok-ionic-samples's Issues

Getting error installing pakage

ionic cordova plugin add https://github.com/msach22/cordova-plugin-opentok/

cordova plugin add https://github.com/msach22/cordova-plugin-opentok/ --save
Error: Failed to fetch plugin https://github.com/msach22/cordova-plugin-opentok/ via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: cmd: Command failed with exit code 1 Error output:
npm ERR! code ENOGIT
npm ERR! No git binary found in $PATH
npm ERR!
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Vaibhav\AppData\Roaming\npm-cache_logs\2017-11-30T11_01_45_338Z-debug.log

[ERROR] An error occurred while running cordova plugin add
https://github.com/msach22/cordova-plugin-opentok/ --save (exit code 1).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.