TeamNewPipe / NewPipe

A libre lightweight streaming front-end for Android.
https://newpipe.net
GNU General Public License v3.0
31.15k stars 3.02k forks source link

Fullscreen sometimes show a quarter of a screen [Android 12] #7262

Closed privacyonly closed 2 years ago

privacyonly commented 2 years ago

ℹ️ Please don't leave a comment like "I am having the same issue" without additional information. Simply upvote the issue instead.

Checklist

Steps to reproduce the bug

  1. open new pipe
  2. press on any videos
  3. press play
  4. press on the full screen

Actual behavior

it is a quarter of full screen on the top left corner of the screen

Expected behavior

full screen

Screenshots/Screen recordings

https://player.vimeo.com/video/633798373

Logs

Device info

privacyonly commented 2 years ago

Funny enough that this cannot be reproduce in android emulator in android studio.

anyway note to myself: adding setRecovery(); at the end of public void onVideoSizeChanged(@NonNull final VideoSize videoSize) { line3938 player.java

decrease the chance of getting quarter screen by a lot.

Outlet2048 commented 2 years ago

Would it be worth to create a pull request as a "bandaid fix" for this? This issue has been going on for over half a year now and I'd be happy with any change, even if it just reduces the chance

privacyonly commented 2 years ago

wait don't do the band aid. I found the real issue. https://developer.android.com/about/versions/12/deprecations so I found a lot of display.getsize in newpipe

edit: I don't think it is part of newpipe, it is in gradle.

Outlet2048 commented 2 years ago

Is someone able to create a PR for this? I don't have any development experience sadly

privacyonly commented 2 years ago

I was about to edit the one above when I discover the final fix, like 100% fix.

I am new to coding so bear with me, I will try my best to create a PR.

I have no idea how this code work or break something

fragmentListener.onFullscreenStateChanged(isFullscreen);

I commented this and it works.

blake-haas commented 2 years ago

without understanding why it is breaking and not having an idea of any regressions you may cause, that PR will surely not get approved. Someone more experienced with newPipe needs to take a look at this issue.

Outlet2048 commented 2 years ago

Is there someone that can be pinged for this or would that not be considered friendly? I'm not too familiar with github etiquette

opusforlife2 commented 2 years ago

Wow, don't discourage someone who's trying to do something productive, guys. Let @privacyonly experiment and learn. Even if the code isn't used, there will be real benefits.

privacyonly commented 2 years ago

ok. I found out what it broke, it is the android nav bar.

edit: I am not sure if I am allowed to post this link

https://mega.nz/file/37ZwSbDA#JYp5Nn4ruxwe6tDcaE9-GbrHxjqCRh33tbGqkG5ntqQ

did this apk solve the problem?

I just moved fragmentListener.onFullscreenStateChanged(isFullscreen); like below

isFullscreen = !isFullscreen;

fragmentListener.onFullscreenStateChanged(isFullscreen);

if (!isFullscreen) {

edit2: cancel the mega link above

now i tried commented this checkLandscape like what does it do?

//checkLandscape();

https://mega.nz/file/3iogzRbB#cIwfejOfRMmNbk0XIVZEuWk-z8USWVfApUctcazI1rk

edit3:

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            addVideoPlayerView();
        } else {
            // KitKat needs a delay before addVideoPlayerView call or it reports wrong height in
            // activity.getWindow().getDecorView().getHeight()
            new Handler().post(this::addVideoPlayerView);
        }

now this is very interesting KitKat needs a delay, how about Android 12 needs a delay?

edit4:

    public void checkLandscape() {
        final AppCompatActivity parent = getParentActivity();
        final boolean videoInLandscapeButNotInFullscreen =
                service.isLandscape() && !isFullscreen && videoPlayerSelected() && !isAudioOnly;

        final boolean notPaused = currentState != STATE_COMPLETED && currentState != STATE_PAUSED;
        if (parent != null
                && videoInLandscapeButNotInFullscreen
                && notPaused
                && !DeviceUtils.isTablet(context)) {

            //try fix #7262
            new Handler().post(this::toggleFullscreen);
        }
    }

https://mega.nz/file/bqYgBLwb#rhKK8VUsFBqsL-kvsZllklnGUc7MDV_lqEIg1pdjYh4

can someone try this apk? did it fix this problem?

privacyonly commented 2 years ago

can someone please try the apk above and give a feedback?

Outlet2048 commented 2 years ago

can someone please try the apk above and give a feedback?

Screenshot_2022-06-28-13-52-09-64_3d73e98b1ad3bd2575f7a56513d89a0c.jpg
AndyP435 commented 2 years ago

This bug affects my phone Galaxy S20 FE 5G, Android 12. Screen resolution 1080x2400, newest version on FDroid as of June 29. I also tried the apk from PrivacyOnly edit 4 and got the "package appears to be invalid" message.

StefMarko commented 2 years ago

I am having the same issue. Android 12, galaxy a52s with one ui 4.1.

barackenkumpel commented 2 years ago

did it fix this problem?

Yes, very well. But the Overlay behaves kinda flashy now

https://user-images.githubusercontent.com/93818968/177987485-08f8a77e-eeaf-4f95-971d-940935a3f5e7.mp4

Donkey-Doug commented 2 years ago

I didn't observe the problem so far so I assume it's somewhat device or software specific.

I have had this issue for a very long time. I believe it happens when a video is still loading (video fully black) and I press maximize. In my case, however, it is always half the screen and not a quarter.

Android 10 Xiaomi mi 9t pro Lineageos without google

Outlet2048 commented 2 years ago

Half the screen happens when you have your video size set to "fill" I think At least either of the two other screen size options produces another outcome than when you use the default video size option. This one produces the "quarter of the screen video"

barackenkumpel commented 2 years ago

It is the same size the video has in minimized state rather than a quarter of the screen. I measured it. Also see this screenshot: pure-white-video_screenshot The red area is usually not used when watching a video because of my screen proportions. When not noticing the red areas it's clearly not a quarter of the screen the video fills.

Stypox commented 2 years ago

Could you try if, by any chance, #8170 fixes the issue? It probably does not, but let's check. This is the direct url to the APK built by the CI: https://github.com/TeamNewPipe/NewPipe/suites/7295032495/artifacts/294324129

Btw @privacyonly, there is no need to upload APKs to Mega, you can just zip them and then upload them here.

yamatt commented 2 years ago

@Stypox I've just tried it out and it looks like it's resolved the issue.

I went into full screen many times and it would always open on the whole screen whereas the current release is maybe 50% of the time.

privacyonly commented 2 years ago

@Stypox, yes this fix the issue, thanks.

Outlet2048 commented 2 years ago

Could you try if, by any chance, #8170 fixes the issue? It probably does not, but let's check. This is the direct url to the APK built by the CI: https://github.com/TeamNewPipe/NewPipe/suites/7295032495/artifacts/294324129

I'm getting a 404 file not found error

privacyonly commented 2 years ago

@AlertSubject login, refresh, download again, it is a zip file.

Outlet2048 commented 2 years ago

@AlertSubject login, refresh, download again, it is a zip file.

Link works fine on Desktop Github mobile app not so much thanks, will test the app

Edit: APK works fine for me, issue no longer exists when using debug APK

wanderinglethe commented 2 years ago

https://github.com/TeamNewPipe/NewPipe/pull/8170 this is only merged into dev, so isn't merged into master yet and therefore not in 0.23.2, right?

(Having the same problems on S21FE, OneUI 4.1 with NewPipe version 0.23.2, except that the "sometimes" is more of an almost always)

Stypox commented 2 years ago

isn't merged into master yet and therefore not in 0.23.2, right?

Yes

navilg commented 1 year ago

Are we still getting this issue ? I don't see it anymore in my phone.

Outlet2048 commented 1 year ago

Are we still getting this issue ? I don't see it anymore in my phone.

Resolved for me

opusforlife2 commented 1 year ago

Hence, why the issue is closed.