Join a session 🔗

First initialize a Session object:

var OV = new OpenVidu();
var session = OV.initSession();

Then by calling session.connect method you can join a properly initialized session.

// After retrieving a token from OpenVidu Server...
    .then( ... )
    .catch( ... );

You must ask OpenVidu Server for a user token. To do so:

  1. Initialize a Session in OpenVidu Server

  2. Create a Connection in this session in OpenVidu Server

  3. Return the Connection's token to your client-side to use it on Session.connect()

You can add an optional second parameter to pass some user metadata that will be received by every other user connected to the same session (check Share data between users to learn more).

session.connect(token, DATA)
    .then( ... )
    .catch( ... );