This section shows you how to prepare and run the sample application. The app is built by the Accelerator Core JS.
Configure the sample app code. Then, build and run the app.
-
Get values for API Key, Session ID, and Token. See OpenTok One-to-One Communication Sample App home page for important information.
-
In app.js, replace the following empty strings with the corresponding API Key, Session ID, and Token values:
apiKey: '', // Replace with your OpenTok API Key sessionId: '', // Replace with a generated Session ID token: '', // Replace with a generated token (from the dashboard or using an OpenTok server SDK)
$ npm install
$ npm run build
$ node server.js
The web page that loads the sample app for JavaScript must be served over HTTP/HTTPS. Browser security limitations prevent you from publishing video using a file://
path, as discussed in the OpenTok.js Release Notes. To support clients running Chrome 47 or later, HTTPS is required. A Node server will work, as will MAMP or XAMPP. You can also use a cloud service such as Heroku to host the application.
For details about how to use the Accelerator Core in the sample app, see here.