Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marqroldan
Copy link
Contributor

@marqroldan marqroldan commented Oct 1, 2021

Explained here: closes #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

  1. 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
Copy link
Contributor Author

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



if (localParticipant != null) {
localParticipant.unpublishTrack(localVideoTrack);
Copy link
Collaborator

@slycoder slycoder Oct 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to verify that localVideoTrack is not null?

Copy link
Collaborator

@slycoder slycoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment, otherwise lgtm!

@devlove1C
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants