4
votes

I have used twilio-video:1.19.2 in angular 8.

I have implemented functionality of one-to-one video call.

Below is my code i use to enable/disable video.

toggleVideo() {
    this.videoConference.isPaused = !this.videoConference.isPaused;
    this.twilioRoom.localParticipant.videoTracks.forEach(track => {
        if (this.videoConference.isPaused) {
            track.disable();
        } else {
            track.enable();
        }
    });
}

Video call seems to work fine. But when i pause video on participant side only some time black screen is displayed. Most of time it freezes video (last recorded frame stays).

This issue is reported on react-twilio library https://github.com/blackuy/react-native-twilio-video-webrtc/issues/165

Does anyone know how to resolve this?

Is there any way to add black(video track) screen?

I want to show black screen when video is paused from participant side.

2

2 Answers

5
votes

Twilio developer evangelist here.

What you need to do in this case is handle the remote user disabling their track and remove it from your local view.

To do this, you can listen for the Participant's trackDisabled event and handle it accordingly.

remoteParticipant.on('trackDisabled', track => {
  // hide or remove the media element related to this track
});

You should ensure to write code to handle the track being enabled again:

remoteParticipant.on('trackEnabled', track => {
  // show the track again
});
0
votes

How To Participant Audio Track Disable.

//Participant is all participant connect with Room. For Ex. User-1 Screen Page Participant User-2, User-3 And User-4.

participant.audioTracks.forEach(function (track) {
//sid is disable Audio track Particular Participant sid. For Ex. User-1 Screen Participant User-3 audio disable using audio track sid It is Possible. If Possible give me code or reference url link.
if (track.sid == sid) {
//participant audio track disable.
     track.disable();
}
else {
     //participant audio track enable.
     track.enabled();
}
});

Any Way Another Way Please Give Code Or Reference URL Link I Do This.