Suggestions

close search

Back to Basic Video Chat Overview

Basic Video Chat Step 2: Creating a session (server side)

  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

In order to run an OpenTok application in the browser, it needs to obtain an OpenTok session ID. To do this, you will need to create a web service that uses one of the OpenTok server-side SDKs.

In this basic tutorial, we've created this for you using the OpenTok PHP SDK. The Learning OpenTok PHP repo includes code for setting up this web service. You should walk through how the service works upon completing this tutorial.

For now, you can quickly deploy the service on Heroku by clicking on the purple button below. Heroku is a PaaS (Platform as a Service) that can be used to deploy simple and small applications for free. You will be prompted to create an account if you don't already have one.

Deploy

Heroku will prompt you to add your OpenTok API key and secret. Log in to your TokBox Account and find them on the Project Page.

The Learning OpenTok PHP web service handles the following API calls:

If you prefer to run this on your own PHP server. See the Learning OpenTok PHP repo.

Next up, you will learn about tokens and how they secure access to your video chat.

  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