Open litetex opened 2 years ago
Here is how I want to restructure the player (service) start/change logic. These static methods should be accessible from anywhere. They should be callable one after the other: for example, if I want to switch the player and enqueue some items, first I call enqueue
and then switchPlayer
.
startPlayer(type, queue, resumePlayback)
switchPlayer(type)
enqueue(queue, mode)
mode
can be "bottom" or "next"I will try to see if all of these actions (except maybe a part of startPlayer
) can be performed without using Intent
s but rather via the player bound to PlayerHolder
.
Here is how I want to restructure the player (service) start/change logic. These static methods should be accessible from anywhere. They should be callable one after the other: for example, if I want to switch the player and enqueue some items, first I call
enqueue
and ... I will try to see if all of these actions (except maybe a part ofstartPlayer
) can be performed without usingIntent
s but rather via the player bound toPlayerHolder
.
What about using a event bus like Greenrobot's EventBus ?
The player intent handling needs major refactoring as it's currently unmanageable - and when bugs occur unfixable (#7427)
Occasions where the player is changed or started
Summarized call hierarchy: ![grafik](https://user-images.githubusercontent.com/40789489/149827742-0d244b1e-6448-4da5-a76f-0dad3c2f6ca5.png) or as plain text: ``` NavigationHelper.getPlayerIntent(Context, ClassIt would be great