Today we are glad to announce an integration with Twilio Video, which was announced earlier this summer. The Twilio Video JS interface can be found on our ever growing Integrations library.
In addition to Twilio Video, there’s also the pre-existing callstats.io integration to Twilio Voice
How to Use
In html:
<!DOCTYPE html>
<html>
<head>
<!-- Load callstats.io library (it provides window.callstats -->
<script src="https://api.callstats.io/static/callstats.min.js"></script>
<!-- Load Twilio Video JS library -->
<script src="//media.twiliocdn.com/sdk/js/video/v1/twilio-video.min.js"> </script>
<!-- Load callstats-twilio-video library (it provides window.callstatstwiliovideo) -->
<script src="https://api.callstats.io/static/callstats-twilio-video.min.js"></script>
<!-- Load our app code -->
<script src="js/app.js"></script>
</head>
<body>
<!-- your stuff -->
</body>
</html>
In app.js:
const Video = Twilio.Video;
Video.connect('$TOKEN', { name: 'room-name' }).then(room => {
callstats = callstatstwiliovideo(room, peerToPeer, AppID, AppSecretOrTokenGenerator, localUserID, csInitCallback, csStatsCallback, configParams);
console.log('Connected to Room "%s"', room.name);
// you can also set the room name later if you don't have the room info while initializing callstats
callstatstwiliovideo.setTwilioVideoRoom(room);
...
});
// Run the callstats-twilio-video library for this Twilio.Video.Room
Comments
0 comments
Please sign in to leave a comment.