PoC for limited PIP mode support on MainPlayer. #8045
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is it?
Description of the changes in your PR
I know it might not a good idea to do this now before the full player refactor, but did it anyways since I keep on seeing reports of unusable Android 12 popups. To avoid making too many changes in the Player, I've restricted the PIP mode to be accessible through minimize action only. There is a user-defined option with clear warning this is a feature under test, since I just want this PR to unblock users so they can play with a minimally viable PIP while devs have more time refactoring the player. This also means the original popups will co-exist with PIP mode.
@Team, please let me know if there are major issues with this implementation or its later maintenance so I can retract the PR and don't go crazy because "this works on my machine". On the Android side, PIP mode is able to take the view at the top of the current activity and expose that through PIP. You can see this when expanding the PIP view, it will also show the
VideoDetailFragment
title, which may or may not be a desirable effect. But since this change aims to touch the internal player code as little as possible, the current video player fragment layout pretty much worked to our advantage.Unfortunately, because of this, when other player ui elements are showing, the layout will clutter the PIP view and would need manual intervention by expand the activity (
VideoDetailFragment
fragment) back to fix it. This is especially apparent when a queue finishes playing or when the player throws an exception. There is also an issue with aspect ratio when restarting a queue after playback has ended. Though these problems can't really be fixed without a player ui update/rewrite. Similarly, because of how the app's activity and fragments are structured, while in PIP mode, you cannot access other parts of the app, such as changing settings or searching for videos. To do this, you will have to wait for a full player refactor IF the team decides to make the player an activity.If you are comfortable with these caveats, please give the PR build a test, especially if you have an Android 12 device, and let me know if there is any non-ui related issue or if there is major issue with the video view.
Before/After Screenshots/Screen Record
Fixes the following issue(s)
APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.
Once installed, go to Settings -> Video and audio -> Minimize on app switch -> Minimize to PIP ... -> Start up a video and context switch when the video is playing
Due diligence