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: improve exoplayer scoping #6307

Merged
merged 2 commits into from
Aug 10, 2024
Merged

Conversation

Pittvandewitt
Copy link
Contributor

This PR splits the PlayerViewModel, so that each fragment or activity where an exoplayer is used has its own properly scoped exoplayer. The result is that an exoplayer is created when the viewmodel of a fragment that needs a player is created and destroyed when the viewmodel is. The exoplayer is no longer recreated upon orientation change.
This means that media keeps playing without interruptions upon orientation change, fixing #5754 (comment)

The exoplayer no longer lives inside the player fragment or in the activity scoped viewmodel.

@Bnyro Bnyro changed the title Fix exoplayer scoping fix: improve exoplayer scoping Aug 10, 2024
Copy link
Member

@Bnyro Bnyro left a comment

Choose a reason for hiding this comment

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

I don't feel any difference when rotating the screen honestly, but it's reasonable to move the player ownership to the view model.

Thanks!

@Bnyro Bnyro merged commit 048fa3b into libre-tube:master Aug 10, 2024
3 checks passed
@Pittvandewitt
Copy link
Contributor Author

I don't feel any difference when rotating the screen honestly, but it's reasonable to move the player ownership to the view model.

Thanks!

I don't feel anything in the update in which this PR is merged either. I'll go back to the drawing board when I got some spare time again to find out why.

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.

2 participants