Merge player classes into a single one#5371
Conversation
|
This has been bugging you for a while, hasn't it? xD |
|
as your PR also modifies the VideoDetailFragment. Can you please remove the lines and that's from PR #5331. So I don't have to do that in another PR and force you to rebase / force push. |
|
I'm in favor of this :) It's always a struggle to "not breaking" stuff because of the |
XiangRongLin
left a comment
There was a problem hiding this comment.
I just did a quick run down, i skipped Player since there is no direct side-by-side comparison. But if you just pulled the methods upwards there shouldn't be much to look at.
PlayerHelper i also just skimmed through for the same reason.
Only thing that i would change is making seperate commits for those points. When looked at afterwards it then shows that its intended and not accidental.
Fix wrong speed indicator in queue activity (finally I understood what ought to be done)
Remove viewpager hiding from #5331
| implements View.OnTouchListener { | ||
| private static final String TAG = ".PlayerGestureListener"; | ||
| private static final boolean DEBUG = BasePlayer.DEBUG; | ||
| private static final String TAG = PlayerGestureListener.class.getSimpleName(); |
There was a problem hiding this comment.
Is this done like this in other places too?
There was a problem hiding this comment.
Yes, this is the way to do it
| getMenuInflater().inflate(R.menu.menu_play_queue, m); | ||
| getMenuInflater().inflate(getPlayerOptionMenuResource(), m); | ||
| onMaybeMuteChanged(); | ||
| onPlaybackParameterChanged(player.getPlaybackParameters()); |
There was a problem hiding this comment.
Where is this coming from?
There was a problem hiding this comment.
This fixes the issue with the speed on the button being wrong
|
Isn't it quite hard to navigate in 4k lines of code? |
Paging @XiangRongLin :) |
|
@TacoTheDank Seeing how my other refactoring&tests PR are still just lying around, I'm not going to touch this. Refactoring something big like this needs many iterations, which does not work if each iteration has a very long wait time just to get feedback. |
|
@XiangRongLin I separated the commits as you requested, and also merged and renamed |
XiangRongLin
left a comment
There was a problem hiding this comment.
Looks ok to me. I trust you with merging those classes, since like many said 4k lines is too much to review.
Yes, this is a chronic problem because of general lack of free time on the team. Plus even when a dev gets some time to work on Newpipe, they might have their own priority regarding what to work on. @XiangRongLin @vkay94 You've both been given write access, so you can approve and merge PRs. Whenever you have the inclination, please go ahead and review/merge PRs that meet your standards. :) Also, @XiangRongLin could you please join the newpipe IRC channel (preferably with a Matrix account)? @vkay94 is already there. |
|
player.getPlayer() or player.isPlayerNull are looking a bit unfortunate. Maybe it should be renamed to exoInstance / playbackInstance or something like that? so it would become player.getExoInstance() and player.isExoInstanceNull |
|
I rebased onto view binding and tested again, everything seems to be working fine. @Redirion I renamed |
|
I will take the bold move to merge this. I think this should go into public testing with the new release. This will give us the opportunity to collect more broad feedback. |
Merge player classes into a single one
What is it?
Description of the changes in your PR
This PR merges the three files of the player, namely
BasePlayer,VideoPlayerandVideoPlayerImpl, into only one. Having three files was totally useless since code randomly spanned across all three files without any clear distinction. Before unified player three different classes were needed to allow for extension, but now that's not needed anymore. Merging everything together also removes lines of code and makes the code simpler to read, since everything is in one place, as there are no overridden methods all over the place anymore.//regionand//endregioncomments before and after each section, allowing them to be folded by the IDE.enumfor player type, also for intents, and therefore useintvalue = type.ordinal()andPlayerType.values()[intvalue]PlayerHelpercheckPopupPositionBoundsso that it tries to clamp both x and y bounds and not only one at a timeplayer.xmlandplayer.xml (large-land), causing view binding to require conversions: see Use view binding in VideoPlayer. #5253 (comment)ServicePlayerActivityandBackgroundPlayerActivityinto a singlePlayQueueActivityand remove useless fieldsgetTagandredraw(which were not used)I'd like this to be merged soon, otherwise it will be a mess to rebase.
Due diligence