-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
Improve fullscreen, orientation and PiP handling #286
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks for the fix. Could you move the onResume
function below onStart
please? That order makes more sense imo considering the activity lifecycle.
@Maxr1998 Thank you for the feedback. Fixed the feedback and the code comment which was outdated. One thing I noticed is that onResume doesn't fully fix the case when returning (maximizing) from Picture in Picture (PiP) mode. In most cases the navigation bar is still visible, but can be hidden by tapping the player window. In rare cases the navigation bar hides when returning from PiP. Any idea? |
I've observed that as well when first implementing PiP, but never found a solution/fix for the issue. I'm thinking it's a bug in the Android framework or ExoPlayer library, but I can't really tell. YouTube opens the video in portrait mode when returning from PiP, so the bug doesn't apply there. Maybe we should do the same to cover it, it also makes sense since you mostly watch through PiP while in portrait. |
@Maxr1998 It took me a while to figure out the fullscreen logic correctly, but I guess with the latest commit I addressed all issues. The behavior of the latest commit is as follows:
Please give it a try. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the other set of changes, looks good to me! Just some small formatting nitpicks to fix, then it's ready to merge!
Thank you @Maxr1998 and @nielsvanvelzen for your code reviews and improvements. |
- Enter fullscreen in onResume if applicable - Allow PiP in N+
Added another small fix (the |
Fixed by delaying the enableFullscreen call in onConfigurationChanged
Fixes #174.
See: https://developer.android.com/training/system-ui/navigation