react-native-twilio-video-webrtc icon indicating copy to clipboard operation
react-native-twilio-video-webrtc copied to clipboard

Cannot reenable video-track after disabling it

Open gpavlov21 opened this issue 3 years ago • 9 comments

Steps to reproduce

  1. Follow the example app 1:1
  2. Add a function toggleVideo():
const toggleVideo = () => {
    if(twilioVideo && twilioVideo.current){
       twilioVideo.current.setLocalVideoEnabled(!isVideoEnabled).then(isEnabled => {
          setIsVideoEnabled(isEnabled)
          })
       }
    }

Expected behaviour

The video should stop/start

Actual behaviour

When I toggle off the video it stops for me and for the remote participant as well, but when I toggle it back ON, it goes on only for me, for the remote participant(web browser), the video-track is not being enabled.

Environment

  • React Native version: 0.63.4

gpavlov21 avatar Dec 28 '21 19:12 gpavlov21

 <TwilioVideoLocalView
          enabled={isVideoEnabled}
          style={styles.imgPatient}
        />  it will work  @gpavlov21 

mumer-saleem avatar Dec 30 '21 10:12 mumer-saleem

@mumer-saleem On Android it still doesn't work

gpavlov21 avatar Jan 02 '22 15:01 gpavlov21

@gpavlov21 did you find solution

mumer-saleem avatar Jan 04 '22 07:01 mumer-saleem

@mumer-saleem no im still struggling to find a solution, almost 1 month later ....

gpavlov21 avatar Jan 22 '22 12:01 gpavlov21

I am facing same issue... any solution??

hpardess avatar Jan 25 '22 20:01 hpardess

No, still no solution. After reviewing all the issues on github, i think this problem is around 2 years old .... @slycoder any idea ?

gpavlov21 avatar Feb 03 '22 02:02 gpavlov21

Hi all, sorry I haven't been able to actively work on it. If someone has a trace of events, that might help debug the issue. For example, what enable/disable publish/unpublish events is the remote participant seeing?

slycoder avatar Feb 21 '22 19:02 slycoder

I'm getting this issue too and for me, remote participant is seeing 'disabled' event on the RemoteVideoTrack, and then 'started' with a new sid. Comparing this to when two browsers are performing the same actions which work, in that case the remote participant sees 'disabled' on the RemoteVideoTrack and then 'enabled' with the same sid.

tzapevalov-tofi avatar Nov 25 '22 05:11 tzapevalov-tofi

I managed to fix it by removing this line https://github.com/blackuy/react-native-twilio-video-webrtc/blob/0231f730b049464c2b447acdce63341e61c6dcc9/android/src/main/java/com/twiliorn/library/CustomTwilioVideoView.java#L720 I don't know what issues this may cause, but now my remote participant is seeing the expected events 'disabled' followed by 'enabled'.

tzapevalov-tofi avatar Nov 25 '22 06:11 tzapevalov-tofi