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

[android] Reset room when JS thread reloads while on call

Open marqroldan opened this issue 4 years ago • 2 comments

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

  1. When participants are in the room for the first time

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

With the PR

  1. Same with no. 1 above,
  2. 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)

marqroldan avatar Oct 01 '21 16:10 marqroldan

Rebased the PR with master, changes are clearer now :D

marqroldan avatar Oct 04 '21 01:10 marqroldan

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?

devlove1C avatar Oct 18 '21 03:10 devlove1C