Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onParticipant{Enabled,Disabled}VideoTrack Freezes Video #165

Open
quachsimon opened this issue Jan 11, 2019 · 9 comments
Open

onParticipant{Enabled,Disabled}VideoTrack Freezes Video #165

quachsimon opened this issue Jan 11, 2019 · 9 comments

Comments

@quachsimon
Copy link

quachsimon commented Jan 11, 2019

Steps to reproduce

  1. User A and B joins a room, both videos are working
  2. User A disables their video

Expected behaviour

  • User B receives the onParticipantDisabledVideoTrack
  • User B sees a black screen on the TwilioVideoParticipantView (which is user A)

Actual behaviour

  • User B receives the onParticipantDisabledVideoTrack
  • User B sees a frozen screen (or the last frame of the video) on the TwilioVideoParticipantView (which is user A)

I noticed that if I toggle the video on User A multiple times (calling setLocalVideoEnabled) fast enough, it will go to be a black screen. Is this because of how streaming works and there is a delay in when user B receives the final stream before user A shuts off their video stream?

I am a newbie when it comes to how video works on Twilio. Any help would be appreciated!

Edit: Another question is, when the onParticipantDisabledVideoTrack is called should we be replacing the TwilioVideoParticipantView with our own custom components?

Environment

  • Node.js version: v11.6.0
  • React Native version: 0.57.8
  • React Native platform + platform version: iOS 12.1.2

react-native-twilio-video-webrtc

Version: master

@slycoder
Copy link
Collaborator

Hm, you might be right about it being a race condition ... can you consistently reproduce the issue (e.g. if you call it twice via a setTimeout).

As for whether it should be replaced with a custom component; I guess that's a product decision for you =).

@keithhackbarth
Copy link
Contributor

Just to chime in on this one. I am able to reproduce this fairly consistently.

Reproduction steps:

  • Setup the Example included in library
  • Connect to a remote participant
  • Disable/Enable remote participants video, 10 times, waiting 30 second in between

Expected:

  • Screen goes black/blank for 10/10 tests

Actual

  • Screen shows last frame of remote video for 8/10 tests

@slycoder
Copy link
Collaborator

Has anyone tried when the other client is not using this library? Just trying to see if it's on the sender side or the receiver side.

@keithhackbarth
Copy link
Contributor

@slycoder - Good question. I think it is actually a Twilio issue. Just tried by spinning up two side-by-sides of this https://github.com/twilio/video-quickstart-js as was able to reproduce using a similar javascript-to-javascript use case - so its not limited to React Native.

@keithhackbarth
Copy link
Contributor

Simple fix for me was to listen for onParticipantDisabledVideoTrack and then just change my state to render a black box instead of the video frame.

@slycoder
Copy link
Collaborator

Thanks for all the deep digging @keithhackbarth and the workaround.

@akvaliya
Copy link

akvaliya commented Oct 24, 2019

@keithhackbarth Can you provide code snippet of how to show black screen on disable video? I am unable to listen to this event.

@HeyWrecker
Copy link

HeyWrecker commented May 12, 2020

@keithhackbarth I'm running into a similar issue and pattern of behavior, using Vue.js in this particular instance. But, same gist. Running the following code on my disable mutation leaves a paused / frozen video rather than a black screen the majority of the time:

const video_tracks = state.room_data.localParticipant.videoTracks;

video_tracks.forEach(function(publication) {
    publication.track.disable();
 });

Even their sample code for localmediacontrols appears to implement a workaround that actively removes the video element from the DOM when muting video.

@imrohangaur
Copy link

listen for onParticipantDisabledVideoTrack and then just change my state to render a black box instead of the video frame.

Hey, I was wondering were you able to find any work around on it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants