Skip to content

Latest commit

 

History

History

Publish-Video

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

OpenTok.js Publish from a Video Element Sample

In this sample application we show you how to publish a Video file to an OpenTok Session. This sample creates a simple Publisher and publishes it to a Session.

As of v2.13 of opentok.js you can set a custom audio source and video source for a publisher's stream when you call OT.initPublisher(). The custom audio and video source are MediaStreamTrack objects. In this sample we obtain a MediaStreamTrack from a Video Element, using the captureStream() method to get a MediaStream object, and then call getVideoTracks()[0] on that object to get the video MediaStreamTrack object and getAudioTracks()[0] to get the audio MediaStreamTrack object.

Demo

Open in StackBlitz

Enter your credentials in config.js and the application will work.

Note: There is a devDependency sirv-cli in the project that is only necessary to run the demo on StackBlitz.

Running the App

Important: Read the following sections of the main README file for the repository to set up and test the application:

Known Limitations