Skip to content
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

Unified Player seekbar not appearing on Android 11 #4277

Closed
ZeroPucks opened this issue Sep 13, 2020 · 31 comments · Fixed by #4272
Closed

Unified Player seekbar not appearing on Android 11 #4277

ZeroPucks opened this issue Sep 13, 2020 · 31 comments · Fixed by #4272
Labels
bug Issue is related to a bug player Issues related to any player (main, popup and background)

Comments

@ZeroPucks
Copy link

Version

Steps to reproduce the bug

  1. Open and play any video on Android 11.
  2. Open the video in landscape fullscreen by rotating the device or tapping on fullscreen toggle.
  3. Tap on the screen to expose video title, pause/play controls, and additional UI elements.

Expected behavior

The seekbar should appear with timestamps, and status bar should disappear.

Actual behaviour

Seekbar does not appear, and status bar is a persistent red bar across top of video, even when the other UI elements are gone.

Screenshots/Screen recordings

Unified Player APKs:

Screenshot_20200913-100018_1
Screenshot_20200913-100035_1

Stable release APK 0.19.8 from 2020-07-28:
https:/TeamNewPipe/NewPipe/releases/download/v0.19.8/NewPipe_v0.19.8.apk

Screenshot_20200913-114858_1

Logs

N/A

Notes

Screenshots taken on Pixel 3a (2220x1080 resolution, no cutouts or notches) running Android 11, sideloaded OTA and factory reset.

@ZeroPucks ZeroPucks added the bug Issue is related to a bug label Sep 13, 2020
@opusforlife2
Copy link
Collaborator

Can you confirm that this or a similar problem doesn't appear on any other media players like VLC and mpv-android?

@opusforlife2 opusforlife2 added the player Issues related to any player (main, popup and background) label Sep 13, 2020
@ZeroPucks
Copy link
Author

ZeroPucks commented Sep 13, 2020

Can confirm the stock YouTube app does not have similar issue, and VLC also does not have a similar issue on latest stable 3.2.12 https://get.videolan.org/vlc-android/3.2.12/, and the latest nightly VLC-Android-3.3.0-armv8-20200913-0135.apk from https://artifacts.videolan.org/vlc-android/nightly-arm64/.

Screenshot_20200913-125738_1
Screenshot_20200913-125909_1

@blackbox87
Copy link

Try my latest test version. It should handle gesture navigation correctly, although I've only been able to test it on Android 10.

@ZeroPucks
Copy link
Author

Thank you for the test APK. It's almost there, the seekbar is just a little off-screen now.

Unrelated to your change, but the persistent red status bar is also still there.

Screenshot_20200913-135536

@blackbox87
Copy link

blackbox87 commented Sep 13, 2020

I can see that it's correctly applying insets, but it looks like your status bar and navigation heights are being reported incorrectly.

Could you please try this test version and let me know the values that it displays?

app-debug.zip

@avently
Copy link
Contributor

avently commented Sep 13, 2020

@blackbox87 see the deprecation notice, maybe it's what we need. Some flags we use also deprecated so some of new methods may be used instead
https://developer.android.com/reference/android/view/View#SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN

@ZeroPucks
Copy link
Author

@blackbox87 Values are as follows:
Status bar: 66
Status bar landscape: 66
Navbar: 44
Navbar landscape: 44

@avently
Copy link
Contributor

avently commented Sep 13, 2020

So hideSystemUi and showSystemUi should be aware about android 11 methods

@blackbox87
Copy link

@avently Maybe it's caused by that, but I'm not sure. The status bar height shouldn't be greater than the navbar on a device without a cutout though.

Honestly, the way I'm fixing most of these issues is more of a hack than a true fix. To do it correctly you'd need to recreate the video player so that it's aware of insets and applies them correctly without all of the calculations that I'm currently having to do.

@avently
Copy link
Contributor

avently commented Sep 13, 2020

@blackbox87

The status bar height shouldn't be greater than the navbar on a device without a cutout though.

In this case navbar is a thin line which has less height than status bar by visual comparison.

To do it correctly you'd need to recreate the video player so that it's aware of insets

Do you know how to do it? It's easy to do in separate activity (just for a player) but not for activity with other fragments. Also the video should be below navbar while other controls should be side-by-side with it. I don't know how to do it without custom calculations

@avently
Copy link
Contributor

avently commented Sep 13, 2020

Actually I know that in theory we can use insets even here but it's hard to do. MainActivity should always be in contact with videodetalfragment. So whenever insets changes new values should be sent to the fragment which should apply side padding to some views. It's possible, maybe even easier than our calculations but I don't have time on testing this idea. Maybe some day

@blackbox87
Copy link

In this case navbar is a thin line which has less height than status bar by visual comparison.

Actually it's not. The value is for the traditional navbar and the gesture controls are handled by insets. I couldn't get a value to return from this though, so I'm using the navbar height + 4dp of extra padding. It works perfectly on Android 10.

Do you know how to do it?

No, otherwise I would of done it already. But I'm going to see if it's possible to add padding to the root view instead of specific controls.

@ZeroPucks
Copy link
Author

May be related to this issue, but I just noticed the bottom of the video is cut off in landscape fullscreen.

Screenshot_20200913-162425
Screenshot_20200913-162435

Let me know if I should open another bug report for this.

@blackbox87
Copy link

@ZeroPucks Does everything work correctly if you disable gesture navigation?

@ZeroPucks
Copy link
Author

Unfortunately no, seekbar is still off-screen with 3-button and 2-button navigation. The fullscreen minimize button is now partially visible. There is more of the video visible, but a portion of the bottom is still cut off.

Again this is on a 18.5:9 screen ratio (2220x1080) on Android 11.

@blackbox87
Copy link

@avently Here's another test version. It contains my changes, but I've also compiled it against API 30 so that I could try out setDecorFitsSystemWindows().

app-debug.zip

@ZeroPucks
Copy link
Author

No difference from the last APK, seekbar is still partially off-screen. Appreciate you trying, though. Hopefully someone else on Android 11 can test to make sure it isn't just my device.

@blackbox87
Copy link

I'll see if I can setup an emulator with Android 11 to try some stuff. I'm currently low on disk space which is why I haven't done that already.

@avently
Copy link
Contributor

avently commented Sep 13, 2020

Please, check this one. Works ok on emulator

android-11.zip

@ZeroPucks
Copy link
Author

@avently Thank you, the status bar is no longer persistent, video is completely visible, and the seekbar is now mostly visible. There is an opaque gesture navigation bar when the UI elements appear, but as you said it works okay.

Screenshot_20200913-192144_1
Screenshot_20200913-192201_1

The seekbar is completely visible when using 3-button and 2-button navigation:

Screenshot_20200913-193805_1
Screenshot_20200913-193822_1

@blackbox87
Copy link

Combined with my changes it'd likely fully fix the problem. I'm not sure what @avently changed though, so can't copy his changes into my build.

@avently
Copy link
Contributor

avently commented Sep 13, 2020

I'm not sure what @avently changed though

second commit in:
#4272

@avently
Copy link
Contributor

avently commented Sep 13, 2020

@ZeroPucks

and the seekbar is now mostly visible

This will be probably fixed by @blackbox87's work so you'll get fully working app. Thank you for detailed issue and testing!

@ZeroPucks
Copy link
Author

@avently and @blackbox87 Thank you both for looking into this issue and working to resolve! Hopefully the changes can be merged with the notification changes in #3178 for a fully-compatible Android 11 build.

@blackbox87
Copy link

blackbox87 commented Sep 14, 2020

Here's my changes with the Android 11 changes from @avently

app-debug.zip

@ZeroPucks There's still some issues though, like the fact that the status bar and navigation bar should be transparent. I don't know if my previous test build fixed that for you?

@ZeroPucks
Copy link
Author

ZeroPucks commented Sep 14, 2020

Thank you @blackbox87, the seekbar is now completely visible and actionable. As you mention, status bar and navigation bar are still opaque. Unfortunately, previous test builds did not change that behavior. Small price to pay, if you ask me.

Screenshot_20200913-201226_1

Big thanks to you and to @avently again for the very fast work to diagnose and fix.

@avently
Copy link
Contributor

avently commented Sep 14, 2020

Try this one. Status bar and navigation bar will be transparent. This apk doesn't include @blackbox87 changes. If everything is fine, I'll upload changes to #4272
android-11-2.zip

@avently
Copy link
Contributor

avently commented Sep 14, 2020

@blackbox87 since you have Android 10, do you see red status bar in fullscreen? Or it's only Android 11 problem? I can apply my status bar fix for Android 10 too if it's needed.

@wb9688
Copy link
Contributor

wb9688 commented Sep 14, 2020

@avently: That red status bar looks a bit like energy saving mode. On my Android 10 phone, I don't see the status bar, but I don't think I can test with energy saving mode, because of Samsung's weird One UI.

Edit: Wait… NewPipe is also red, duh…

@blackbox87
Copy link

@blackbox87 since you have Android 10, do you see red status bar in fullscreen? Or it's only Android 11 problem? I can apply my status bar fix for Android 10 too if it's needed.

I installed an Android 10 ROM to test things, but went back to my Android 9 backup. Luckily I still have screenshots though, so I can confirm that the issues unique to Android 11. On Android 10 the status bar, navigation bar and gesture bar are all transparent.

@ZeroPucks
Copy link
Author

Try this one. Status bar and navigation bar will be transparent. This apk doesn't include @blackbox87 changes. If everything is fine, I'll upload changes to #4272
android-11-2.zip

Confirmed, status bar and navigation bar are transparent on Android 11 with gesture navigation. As you said, it does not include @blackbox87 changes so the seekbar padding isn't quite there. But everything is on-screen and transparent as advertised.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug player Issues related to any player (main, popup and background)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants