DEV Community

Discussion on: Build an in browser video chat with screen sharing using Twilio Video

philnash profile image
Phil Nash Author

Do you mean just share the camera and not the microphone?

If so, then yes. You can do so by only requesting or passing a camera stream to the Video.connect function. For example:

Video.connect(token, { audio: false, video: true });

You could just share a screen too, but you would have to get the screen with getDisplayMedia and then pass the track to Video.connect. Something like:

getDisplayMedia().then(stream => {
  const track = stream.tracks[0];
  Video.connect(token, { tracks [track] });