Twilio JavaScript SDK to VidyoClient JavaScript SDK
Last updated
Last updated
This guide walks you through how to migrate your existing to . To complement this guide, we have also developed a sample app that can switch between the Twilio SDK and Vidyo SDK by simply using a build-time configuration. This app provides a handy “translation guide” between Twilio and VidyoClient (Connector) JavaScript SDK. Navigate here for complete source code reference:
If you are starting a new project from scratch, we recommend looking at:
To begin, install the VidyoClient JavaScript SDK:
You can uninstall the Twilio SDK from your project by uninstalling the package:
Twilio uses JSON Web Tokens (JWT) to generate a token for users to join sessions. Vidyo follows a different model: a meeting room is created on backend middleware (referred to as the VidyoPortal) which generates a meeting link, and users join the room through their browser by clicking on the meeting link. For more information visit Getting Started.
Twilio requires a token to join a meeting room.
Twilio has a concept of video and audio tracks. To render the self-view, Twilio appends a video element inside the specified div.
Since Twilio video is track based - you must loop through each video track to unpublish the video, stop the video camera, and remove the video element from the DOM:
Twilio uses participantConnected and trackSubscribed event listeners to determine which remote videos to render:
Since Twilio audio is track based - you must loop through each audio track to start the audio, and add the audio element to the DOM:
Since Twilio API is track based - you must loop through each audio track to mute/unmute the microphone.
Mute:
Unmute:
Twilio has event listeners for participant management, allowing you to detect changes that occur during a meeting.
User joins or leaves a session:
Active speaker changes:
While Twilio requires to set the quality of the video, Vidyo handles the video quality automatically based on network conditions and device capabilities. In low bandwidth conditions Vidyo prioritizes audio over video, and shared content video tiles over participant video. Vidyo also supports configuration options to limit maximum resolution of local or remote video.
This guide covers only the fundamentals for migrating an application from the Twilio JavaScript SDK to the Vidyo JavaScript SDK. If you do not see a piece of functionality described in this guide, please take a look at our or the . If you have any technical questions or run into issues with your migration, you can reach out to the Support team at support@vidyocloud.com