Created
September 12, 2019 16:53
-
-
Save pabloFuente/508e758bd811bf72c877b92bc5b81152 to your computer and use it in GitHub Desktop.
OpenVidu 11 lines of code JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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