Skip to content

Fix: Issue where upon video completion in fullscreen landscape, the device does not revert back to portrait mode#13178

Open
volatilespecial wants to merge 1 commit intoTeamNewPipe:devfrom
volatilespecial:work/fix/13057
Open

Fix: Issue where upon video completion in fullscreen landscape, the device does not revert back to portrait mode#13178
volatilespecial wants to merge 1 commit intoTeamNewPipe:devfrom
volatilespecial:work/fix/13057

Conversation

@volatilespecial
Copy link

What is it?

  • Bugfix (user facing)

Description of the changes in your PR

Bug fix with the player in fullscreen landscape. When the video ends, the player now exits fullscreen mode with the correct orientation.

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. You can find more info and a video demonstration on this wiki page.

Due diligence

@github-actions github-actions bot added the size/small PRs with less than 50 changed lines label Feb 2, 2026
@volatilespecial volatilespecial marked this pull request as ready for review February 2, 2026 10:27
@volatilespecial
Copy link
Author

I forgot to remove the Debug part. I'll do that now.

@ShareASmile ShareASmile added bug Issue is related to a bug player Issues related to any player (main, popup and background) labels Feb 2, 2026
@ShareASmile ShareASmile added the ready for review Most of the work is done, PR is now ready for a review label Feb 24, 2026
@vmarinescu
Copy link

Personally, I would recommend adding a configuration option to rotate back to portait on video end. Perhaps only show it in case the option "Start main player in fullscreen" is enabled.

@dustdfg
Copy link
Contributor

dustdfg commented Mar 2, 2026

Personally, I would recommend adding a configuration option to rotate back to portait on video end. Perhaps only show it in case the option "Start main player in fullscreen" is enabled.

It is a one more option. We try to constraint amount of options because most of it won't be discovered by users and moreover. Additionally the behavior itself is considered buggy by all people. Especially because it not only turns the screen for newpipe but turns screen for whole android so it means you mess with user expectations that your app doesn't stab you...

@vmarinescu
Copy link

I understand your point. Would just be great if advanced users could achieve their desired behaviour without actually forking the repo. Do you have any suggestion for me?

@dustdfg
Copy link
Contributor

dustdfg commented Mar 4, 2026

  1. Please use "normal" commit history it is easier this way to review
  2. Player is a mess and logic of screen rotation is actually mixed with logic when you need to do that rotation... It is too much for me to accommodate all the states in my mind (including tablet and tv)
  3. I am stupid so I am stopping pretending that I can "review" this PR... So I can only wish you to be patient when someone who knows player will come and review this
  4. I've tried to investigate it a bit more and I think that maybe you should look at how fullscreen button is implemented too. Maybe they could even share the same implementation but not sure for 100%
    binding.screenRotationButton.setOnClickListener(makeOnClickListener(() -> {
    // Only if it's not a vertical video or vertical video but in landscape with locked
    // orientation a screen orientation can be changed automatically
    if (!isVerticalVideo || (isLandscape() && globalScreenOrientationLocked(context))) {
    player.getFragmentListener()
    .ifPresent(PlayerServiceEventListener::onScreenRotationButtonClicked);
    } else {
    toggleFullscreen();
    }
    }));
  5. Good luck!

@volatilespecial
Copy link
Author

Alright, so I've cleaned the commit history as requested. This fix reverts the orientation back to portrait after the video ends by tracking the orientation everytime toggleFullscreen is called.

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) ready for review Most of the work is done, PR is now ready for a review size/small PRs with less than 50 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fullscreened video does not revert to portrait view on completion

4 participants