Skip to content

Instantly share code, notes, and snippets.

@pabloFuente
Created September 12, 2019 16:53
Show Gist options
  • Save pabloFuente/508e758bd811bf72c877b92bc5b81152 to your computer and use it in GitHub Desktop.
Save pabloFuente/508e758bd811bf72c877b92bc5b81152 to your computer and use it in GitHub Desktop.
OpenVidu 11 lines of code JS
var OV = new OpenVidu();
var session = OV.initSession();
session.on('streamCreated', event => {
session.subscribe(event.stream, “subscribers”);
});
session.connect(TOKEN).then(() => {
var publisher = OV.initPublisher("publisher");
session.publish(publisher);
}).catch(error => {
console.log("Error connecting to the session", error.code, error.message);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment