Suggestions

close search

Back to Basic Video Chat Overview

Basic Video Chat Step 2: Configuring and testing the app

  1. 1
    Basic Video Chat Step 1:
    Setting up the test web service
  2. 2
    Basic Video Chat Step 2:
    Configuring and testing the app
  3. 3
    Basic Video Chat Step 3:
    Initializing an OpenTok session
  4. 4
    Basic Video Chat Step 4:
    Connecting to the session
  5. 5
    Basic Video Chat Step 5:
    Publishing a stream to the session
  6. 6
    Basic Video Chat Step 6:
    Subscribing to audio-video streams
  1. Clone the https://github.com/opentok/learning-opentok-web repository:

     git clone git@github.com:opentok/learning-opentok-web.git
     cd learning-opentok-web
    
  2. Make sure that you have the basic branch checked out. You can switch to basics branch using the git checkout basics command.

  3. Open the web/js directory and make a copy of the sampleconfig.js file, naming it config.js.

  4. Edit the config.js file and set the value for SAMPLE_SERVER_BASE_URL.

    If you deployed a the test web service to a local PHP server, set this to the following:

     var SAMPLE_SERVER_BASE_URL = 'http://localhost:8080';
    

    If you deployed this to Heroku, set this to the following:

     var SAMPLE_SERVER_BASE_URL = 'https://YOUR-HEROKU-APP-URL';
    

    Do not add the trailing slash of the URL.

  5. The web app lives at index.html. You will need to run this on a web server. If you have Python on your system, you can start the web server by running python -m SimpleHTTPServer 8000 in the web folder.

  6. Once you have the server running open the index.html in a supported browser. For example, if your local web server is running on port 8000, load the following URL:

    http://localhost:8000

    The OpenTok.js library is supported in Chrome, Firefox, and Internet Explorer 10 - 11. (Internet Explorer requires installation of the OpenTok plugin, which the library asks you to install, if you haven't already.)

  7. When prompted, grant the page access to your camera and microphone.

  8. Mute the speaker on your computer, and then load the page again in another browser tab.

    You will see a person-to-person video chat session using OpenTok.

Got it! Go to step 3
  1. 1
    Basic Video Chat Step 1:
    Setting up the test web service
  2. 2
    Basic Video Chat Step 2:
    Configuring and testing the app
  3. 3
    Basic Video Chat Step 3:
    Initializing an OpenTok session
  4. 4
    Basic Video Chat Step 4:
    Connecting to the session
  5. 5
    Basic Video Chat Step 5:
    Publishing a stream to the session
  6. 6
    Basic Video Chat Step 6:
    Subscribing to audio-video streams