-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Rewrite the player (and all its components) #7939
Comments
This is also necessary now more than ever due to the way both the player and NewPipe's Extractor are currently failing to reliably parse and play WebM videos. Particularly WebM VP9 videos are causing Extractor errors. |
Something I was thinking about the other day is the following. We should differentiate between the player logic and the UI.
|
Separating the player logic is definitely a good start. Now that the player feature set is mature enough, is it possible to design a model that captures the full player state so it can reliable reconstruct, for example, after a crash? Following from that, what about the size of the player state. Do we want to keep an entire play queue in memory with thousands of items? Or continue passing that via intent? Should the player state be persistent in database and constantly updated perhaps? And if the player can be reliably reconstructed, would it make sense to drop some complex features, such as the on-the-fly video quality selector? |
Is it possible to refactor the player in small chunks instead of one huge PR? I'm thinking if it is possible, the effort could be spread out over several releases (since it's not a user-facing change), so that no one dev is burdened by a huge TODO. |
Stumbled upon this blogpost from ExoPlayer, which will be merged into AndroidX Media3 in the future. Maybe the player rewrite should target Media3 instead of building from scratch again, since it has an interesting set of dependencies, including ui and cast. |
Note that the cast extension cannot be included in NewPipe as it uses Play Services components. |
Indeed, but doesn't a partial rewrite is still needed for the Android Picture in Picture implementation in the app? |
Yes, definitely. I added that to the TODO list in #8616 |
Checklist
Feature description
The player codebase is pretty hard to understand, is very old, and uses several deprecated methods (which may have been already removed in the latest ExoPlayer versions)/old ways to do some things in ExoPlayer.
The current implementation also does not really allow the implementation of the Android Picture and Picture API (or it is really hard to do), required for Android 12+ devices to prevent untrusted touches outside the popup window, as an activity or a fragment is required to enter the PiP mode. The player seems to be added manually with a view within the
VideoDetailFragment
(that's probably not a good idea at all to enter this fragment into PiP mode).We currently have some player bugs for which we don't really have a way to detect them and/or fix them, like the playback position reset when switching at least manually player type (that we fixed with a workaround).
We may split the player into two parts such as a part in a fragment and the ExoPlayer part in a separate class and file.
Why do you want this feature?
I want this "feature" mainly to fix weird player bugs, update to new ExoPlayer APIs, fix popup mode on Android 12+ devices but also to improve code readability and maintenability and make comments about the player code such as
the player is a hot pile of 💩
orthe code is a spaghetti monster of doom
gone.The text was updated successfully, but these errors were encountered: