How can I make Twilio Video Call app just like whatsapp video call?

512 views Asked by At

I dont want to use the concept of adding room name and then enter a room. I want to do a video call like whastapp video call. It should notify the other user at their end in the app i'm creating.

I followed several online videos but those were like creating rooms only, and not the direct video call.

1

There are 1 answers

0
Partha Paul On

Twilio Evangelist here.

While Twilio Video does not natively support the specific feature of making direct video calls similar to WhatsApp calls out of the box, you can achieve your desired use case by implementing a customized calling experience using the Twilio Video SDK. Unlike the Voice SDK, the Video SDK does not include a built-in calling experience, but by following the steps outlined below, you can create a tailored solution to enable direct video calls.

Here's a high-level overview of how you can implement the calling experience:

Choose a notification service: Decide on a notification service that suits your needs. Twilio Notify is one option, but please note that it will be deprecated soon (End-of-Life on April 25, 2024). As an alternative, you could consider services like Socket.io, Firebase, Pusher, or PubNub.

Send a notification: When User A indicates they want to call User B, your backend server should send a notification to User B using the chosen notification service. The notification should contain a Video Access Token that User B will use to connect to the video Room. User A should not be placed in the Room at this point.

Handle the notification: When User B receives the notification, you can display a user interface indicating that User A is calling. This could involve playing a ringing sound, showing a "User A is calling you" screen, or any other desired visual and auditory cues.

Accept the call: If User B accepts the call, the app should call .connect() and pass the Access Token received in step 2. This will connect User B to the video Room. At this stage, you can create the Room and add both User A and User B as participants, enabling them to communicate with each other.

Please note that there are currently no specific code examples available for implementing this solution using JavaScript. However, Twilio provides an example for Video-invite calls using the Android SDK, which you can access at this link: https://github.com/twilio/video-quickstart-android/tree/master/exampleVideoInvite

I hope this information helps you in achieving your solution.