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

Switching Participant to Local and vice versa not working

Open codemeall opened this issue 6 years ago • 14 comments

Switching Participant View to Local and at the same time Switching the thumbnail respectively doesn't work in android, IOS it works fine, need help with this, is there any thing additional I have to do in Android?

codemeall avatar Aug 14 '19 19:08 codemeall

the local and participant views are changing fine but when Local Video View is switch to primary then it overlaps the participant thumbnail, need help to change the default zindex or the default overlap of Local Video

codemeall avatar Aug 15 '19 13:08 codemeall

Hi, just wanted to get some clarification. Are you saying that the views do not respect the zIndex style property?

slycoder avatar Aug 16 '19 06:08 slycoder

Yes Exactly, when I make LocalVideo as primary it overlaps the Peer's Video thumbnail, and I changed the applyZorder to false in "twilioVideoPreview" file of android and it worked fine then, need to make applyZorder dynamic for android.

codemeall avatar Aug 16 '19 06:08 codemeall

Oh yeah, that makes sense! I'm a bit busy at the moment; it sounds like you know where the issue is so if you wanna send a PR I'd be happy to merge.

slycoder avatar Aug 16 '19 06:08 slycoder

Sure, I'll make a PR.

codemeall avatar Aug 16 '19 06:08 codemeall

@codemeall Hey, did you already create the PR?

DanielMenke avatar Dec 09 '20 18:12 DanielMenke

I have the same issue. Does anyone have any solutions?

RonicleyNuvidio avatar Jul 15 '21 12:07 RonicleyNuvidio

@RonicleyNuvidio More of a workaround, but this seems to work:

change your node_modules/react-native-twilio-video-webrtc/android/src/main/java/com/twiliorn/library/TwilioVideoPreview.java to:

 package com.twiliorn.library;
 import com.facebook.react.bridge.WritableMap;
 import com.facebook.react.uimanager.ThemedReactContext;

 public class TwilioVideoPreview extends RNVideoViewGroup {

     private static final String TAG = "TwilioVideoPreview";

     public TwilioVideoPreview(ThemedReactContext themedReactContext) {
         super(themedReactContext);
         CustomTwilioVideoView.registerThumbnailVideoView(this.getSurfaceViewRenderer());
         this.getSurfaceViewRenderer()
         .applyZOrder(false);  // <==== THIS IS IMPORTANT!!
     }
 }

And build again

DanielMenke avatar Jul 15 '21 13:07 DanielMenke

@DanielMenke Just changing to false works on both ios and android?

RonicleyNuvidio avatar Jul 15 '21 14:07 RonicleyNuvidio

@RonicleyNuvidio No it just fixes the Android build. Had no problems with iOS, luckily.

DanielMenke avatar Jul 15 '21 16:07 DanielMenke

Tks @DanielMenke

RonicleyNuvidio avatar Jul 15 '21 16:07 RonicleyNuvidio

@DanielMenke Do you know if someone makes a pull request to fix this problem?

RonicleyNuvidio avatar Jul 15 '21 16:07 RonicleyNuvidio

@RonicleyNuvidio I don't think that this is a proper solution. Its more of a workaround. @slycoder what do you say?

DanielMenke avatar Jul 15 '21 17:07 DanielMenke

Hey all, please give #375 a try and see if that fixes the issue for you. That PR adds a new prop to configure the z indexes on android.

slycoder avatar Jul 18 '21 17:07 slycoder