twilio / video-quickstart-js

A quickstart and code samples for Twilio Video JavaScript SDK. https://www.twilio.com/docs/video
Other
389 stars 337 forks source link

Is one-way video call supported? #179

Closed akshayKhot closed 3 years ago

akshayKhot commented 3 years ago

Hi,

First of all, thank you for providing this quickstart application as a prototype. It has helped us to quickly build and launch our video application for many users.

Our application looks very similar to the quickstart app. It allows two parties (A and B) to have a video call with each other. This works as expected.

However, the use case for our application doesn't strictly need a webcam for both users. Not all of our A users have webcams on their machine, but they want to see the B's stream. B users are always guaranteed to have their webcams. As long as one participant (B) has a webcam, and both A and B have their microphones, the video call should work.

I wanted to know if Twilio supports this use case. That is, allowing a call even if one of the participants doesn't have a video device.

If yes, what changes would be needed in the codebase?

We would appreciate any advice or guidance from Twilio.

Regards, Akshay

makarandp0 commented 3 years ago

Hello @akshayKhot, Thank you for your question. Yes twilio supports the use case where one of the participant does not have video device. For this you can set video: false in connectOptions - that way the SDK will not try to acquire the video track when connecting. Another option would be to specify the tracks to share explicitly like:

   const tracks = await acquireTracks();
    // Join the Room.
    await joinRoom(token, { name: roomName, tracks });

The acquireTracks function would use createLocalTracks api to acquire the tracks needed. To find out if a client has a video input device or not you can check out this sample - which shows how to enumerate available devices.

Thanks, Makarand

akshayKhot commented 3 years ago

Hi @makarandp0,

Setting video: false in the connectOptions did the trick. Our customers are going to love this feature.

Thank you so much for a prompt reply with the extra information about the API. I really appreciate it.

Regards, Akshay