react-native-twilio-video-webrtc
react-native-twilio-video-webrtc copied to clipboard
Video attach/detach not worked properly at browser side on video on/off from mobile(android) app side respectively multiple time.
Steps to reproduce
- Connect a video call from Mobile(Android) to Browser
- on/off video from mobile app side. Browser side got to know that, they have on/off video from app side(bind/unbind video at browser side on participant on/off accodingly)
- after a first time. do camera on/off again. so, Video Didn't bind at browser side.
[Note : Worked properly in Iphone and Google pixel phone, try in other andrid phone. Like samsung, oneplus, Realme, Vivo, Redmi...]
Expected behaviour
- when remote participant on/off camera from Android Mobile phone then video of remote participant should be bind/unbind properly at browser side.
Actual behaviour
- when remote participant on/off camera from Android Mobile phone then, video of remote participant bind /unbind not worked properly at browser side.
Environment
- Node.js version: 14.18.2
- React Native version: 0.64.4
- React Native platform + platform version: Android
Reactjs Environment
- ** React Js Version : "react": "^17.0.2"
- ** Twilio Package version : "twilio-video": "^2.27.0"
react-native-twilio-video-webrtc
Version: 2.27.0
https://github.com/blackuy/react-native-twilio-video-webrtc/assets/133477471/1300d818-c6c3-4ba2-8d4a-ed1b26634eb2
I faced the same and my (Android) solution was to modify the project it self:
node_modules/react-native-twilio-video-webrtc/android/src/main/java/com/twiliorn/library/CustomTwilioVideoView.java
Remove Line 720
https://github.com/blackuy/react-native-twilio-video-webrtc/blob/d3aed6f64efd476e50cc302dbb13de94fc5f9943/android/src/main/java/com/twiliorn/library/CustomTwilioVideoView.java#L720C13-L720C30
from:
if (localVideoTrack != null) {
localVideoTrack.enable(enabled);
publishLocalVideo(enabled);
WritableMap event = new WritableNativeMap();
event.putBoolean("videoEnabled", enabled);
pushEvent(CustomTwilioVideoView.this, ON_VIDEO_CHANGED, event);
}
to
if (localVideoTrack != null) {
localVideoTrack.enable(enabled);
WritableMap event = new WritableNativeMap();
event.putBoolean("videoEnabled", enabled);
pushEvent(CustomTwilioVideoView.this, ON_VIDEO_CHANGED, event);
}
Basically I just removed publishLocalVideo(enabled);
I hope this helps