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

Fix issue where DownloadedPlayerActivity interferes with MainActivity #674

Merged
merged 2 commits into from
Oct 10, 2023

Conversation

Luna712
Copy link
Contributor

@Luna712 Luna712 commented Oct 8, 2023

Fixes #605

@Luna712
Copy link
Contributor Author

Luna712 commented Oct 8, 2023

This might not be the best way to do this, but it works. If there is a better way, then I apologize this can be closed and that can be tried.

@Luna712 Luna712 marked this pull request as draft October 9, 2023 18:07
@LagradOst LagradOst marked this pull request as ready for review October 9, 2023 19:33
Copy link
Contributor

@LagradOst LagradOst left a comment

Choose a reason for hiding this comment

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

bro, I honestly don't see how this fixes the problem, but yet it does??????

@Luna712
Copy link
Contributor Author

Luna712 commented Oct 9, 2023

bro, I honestly don't see how this fixes the problem, but yet it does??????

@LagradOst

I updated this for a more efficient solution (seemingly), I realized there was an issue where if you opened download activity then main activity, it tried opening the MainActivity in a PiP window then crashes, this separates the tasks more efficiently now (from testing anyway).

@Luna712
Copy link
Contributor Author

Luna712 commented Oct 9, 2023

Basically before, I was wrong, it didn't fix the issue, just reversed its behavior, before it used the most recent opened activity then the first activity failed to respond, the original fix made it crash if say DownloadedPlayerActivity is open in PiP then you try opening MainActivity, it tries opening MainActivity in DownloadedPlayerActivity loading the main application, then crashing because it tries to load an activity already running. The new way, makes DownloadedPlayerActivity use launchMode of singleTask and a taskAffinity for the task ID to prevent conflicts, then ensures the application activity instance is changed when activity is resumed to support both activities running at the same time.

@LagradOst LagradOst merged commit 5b4fd8d into recloudstream:master Oct 10, 2023
2 checks passed
@Luna712
Copy link
Contributor Author

Luna712 commented Oct 10, 2023

Thanks for merging, this does make the DownloadedPlayerActivity a lot more proper implementation now, allowing it to be split into a second window altogether so you can say play something from file manager, pause it, go to main CloudStream, and return to the paused window later on without having to replay it. It's when reason I went with that approach and it solved one of the most annoying bugs in the app to me, with this now done, and preview seekbar implemented, I finally was able to make CloudStream the default media player on my phone. Thanks for all your hard work with the app as well!

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

Successfully merging this pull request may close these issues.

Opening an external video in "Open with..." using CloudStream breaks things
2 participants