Don't switch to landscape for portrait videos (#2665)

This commit is contained in:
dumdum7
2022-06-14 03:19:12 +02:00
committed by GitHub
parent 900ba936a9
commit 582ffa1420
2 changed files with 17 additions and 9 deletions

View File

@@ -185,15 +185,6 @@ export const ScenePlayer: React.FC<IScenePlayerProps> = ({
});
settings.updateDisplay();
(player as any).landscapeFullscreen({
fullscreen: {
enterOnRotate: true,
exitOnRotate: true,
alwaysInLandscapeMode: true,
iOS: false,
},
});
(player as any).markers();
(player as any).offset();
(player as any).sourceSelector();
@@ -495,6 +486,22 @@ export const ScenePlayer: React.FC<IScenePlayerProps> = ({
if (!auto && scene.paths?.screenshot) player.poster(scene.paths.screenshot);
else player.poster("");
const isLandscape =
scene.file.height &&
scene.file.width &&
scene.file.width > scene.file.height;
if (isLandscape) {
(player as any).landscapeFullscreen({
fullscreen: {
enterOnRotate: true,
exitOnRotate: true,
alwaysInLandscapeMode: true,
iOS: false,
},
});
}
// clear the offset before loading anything new.
// otherwise, the offset will be applied to the next file when
// currentTime is called.