Merge fcec04f96d793ce1dd6406e79c46263bf3bcdbaa into 35b70c5e9e8d791ae268bac677a3b760b1b4e8bf

This commit is contained in:
Anparasan Anpukkody 2026-02-20 12:48:57 +01:00 committed by GitHub
commit 8a12ddd519
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -234,7 +234,6 @@ public final class MainPlayerUi extends VideoPlayerUi implements View.OnLayoutCh
@Override
public void destroy() {
super.destroy();
// Exit from fullscreen when user closes the player via notification
if (isFullscreen) {
toggleFullscreen();
@ -943,6 +942,15 @@ public final class MainPlayerUi extends VideoPlayerUi implements View.OnLayoutCh
binding.metadataView.setVisibility(isFullscreen ? View.VISIBLE : View.GONE);
binding.playerCloseButton.setVisibility(isFullscreen ? View.GONE : View.VISIBLE);
setupScreenRotationButton();
// When the video ends, the player exits fullscreen mode but remains in landscape mode.
// This corrects the orientation. See #13057.
if (player.getCurrentState() == STATE_COMPLETED) {
player.getFragmentListener()
.ifPresent(PlayerServiceEventListener::onScreenRotationButtonClicked);
}
}
public void checkLandscape() {