react-native-twilio-video-webrtc
react-native-twilio-video-webrtc copied to clipboard
[android] Reset room when JS thread reloads while on call
Explained here: closes https://github.com/blackuy/react-native-twilio-video-webrtc/issues/559
tl;dr title + componentWillUnmount doesn't get called when you restart the JS thread
This PR updates the existing releaseResource() to be also used inside the constructor and onHostDestroy
Behavior in master branch
-
When participants are in the room for the first time

-
When one participant have their JS thread reload and attempt to join again

With the PR
- Same with no. 1 above,
- LocalView and participant feed can now be seen again

Notes:
- Formatted with Android studio
Question/Concern:
- I am not sure if the mediaListeners for the remote participants are automatically cleared? I believe they are when you disconnect from the room
- There might be cases where we want the room to still be connected, but I'm not sure how to properly handle this
- For example launching a native UI when you receive a call, and then continuing in the JS thread.
- Maybe such functionality can be added in the future by exposing a boolean or something (not an Android developer hehe)
- For example launching a native UI when you receive a call, and then continuing in the JS thread.
Rebased the PR with master, changes are clearer now :D
Hi team, I tried the given solution, but still occurring the same issue. I checked, updated code is not available in the master Branch, I replaced the "CustomTwilioVideoView.java" file in my project, even tried with the piece of code which you added for the issue, But it's giving the same error. Team when you will merge this code to the master branch?