Skip to content

fix: return to portrait after video finish in fullscreen#13543

Open
Y2kz wants to merge 2 commits into
TeamNewPipe:devfrom
Y2kz:fix/issue-5967-Return-to-portrait-after-video-finish-in-fullscreen
Open

fix: return to portrait after video finish in fullscreen#13543
Y2kz wants to merge 2 commits into
TeamNewPipe:devfrom
Y2kz:fix/issue-5967-Return-to-portrait-after-video-finish-in-fullscreen

Conversation

@Y2kz

@Y2kz Y2kz commented May 25, 2026

Copy link
Copy Markdown
Contributor

What is it?

  • Bugfix (user facing)
  • Feature (user facing) ⚠️ Your PR must target the refactor branch
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

With the changes in PR , video now switches back to portrait mode when playback is completed , closed using the "X" button.
This also fixes the case mentioned in #13482 , where the video is minimised by swiping down and then closed using the "X" button. Additionally, double swiping down the video to close it also returns the app to portrait mode.

Note on config: Tablet mode Off / Auto (with less than 480 dp)

Before/After Screenshots/Screen Record

  • Before:

  • After:
screen-20260524-141327-1779612153401.mp4

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 May 25, 2026

@TobiGr TobiGr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you

Comment on lines +1480 to +1481
activity.getContentResolver(), Settings.System.USER_ROTATION, 0);
if (userRotation == 1 || userRotation == 3) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use the surface rotation constants here to increase the readability.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

userRotation == Surface.ROTATION_90 || userRotation == Surface.ROTATION_270 insted of == 1 || == 3 correct?

Comment on lines +943 to +959
if (globalScreenOrientationLocked(activity)) {
// Restore correct orientation according to system rotation lock settings
// when exiting fullscreen mode.
final int userRotation = Settings.System.getInt(
activity.getContentResolver(),
Settings.System.USER_ROTATION, 0);
if (userRotation == 1 || userRotation == 3) {
activity.setRequestedOrientation(
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
} else {
activity.setRequestedOrientation(
ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
} else {
activity.setRequestedOrientation(
ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is a complete duplicate. I'd prefer to have this extracted into a method which is called here and in the VideoDetailFragment.

@Y2kz Y2kz May 25, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to clarify, do you have a specific location in mind for this ? planning to add in PlayerHelper

@TobiGr TobiGr added bug Issue is related to a bug player Issues related to any player (main, popup and background) labels May 25, 2026
@Y2kz Y2kz force-pushed the fix/issue-5967-Return-to-portrait-after-video-finish-in-fullscreen branch 2 times, most recently from c41014a to 8f450de Compare May 25, 2026 14:28
@Y2kz Y2kz requested a review from TobiGr June 1, 2026 17:29
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) size/small PRs with less than 50 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants