mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-28 16:50:29 +01:00
wip: orientation setting
This commit is contained in:
@@ -254,7 +254,6 @@ export const CurrentlyPlayingBar: React.FC = () => {
|
|||||||
*/
|
*/
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!currentlyPlaying) {
|
if (!currentlyPlaying) {
|
||||||
// Reset all local state and shared values
|
|
||||||
progress.value = 0;
|
progress.value = 0;
|
||||||
min.value = 0;
|
min.value = 0;
|
||||||
max.value = 0;
|
max.value = 0;
|
||||||
@@ -262,27 +261,24 @@ export const CurrentlyPlayingBar: React.FC = () => {
|
|||||||
localIsBuffering.value = false;
|
localIsBuffering.value = false;
|
||||||
sliding.current = false;
|
sliding.current = false;
|
||||||
hideControls();
|
hideControls();
|
||||||
|
|
||||||
resetOrientation();
|
|
||||||
} else {
|
} else {
|
||||||
// Initialize or update values based on the new currentlyPlaying item
|
|
||||||
progress.value =
|
progress.value =
|
||||||
currentlyPlaying.item?.UserData?.PlaybackPositionTicks || 0;
|
currentlyPlaying.item?.UserData?.PlaybackPositionTicks || 0;
|
||||||
max.value = currentlyPlaying.item.RunTimeTicks || 0;
|
max.value = currentlyPlaying.item.RunTimeTicks || 0;
|
||||||
showControls();
|
showControls();
|
||||||
|
}
|
||||||
|
}, [currentlyPlaying]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!currentlyPlaying) {
|
||||||
|
resetOrientation();
|
||||||
|
} else {
|
||||||
setOrientation(
|
setOrientation(
|
||||||
settings?.defaultVideoOrientation ||
|
settings?.defaultVideoOrientation ||
|
||||||
ScreenOrientation.OrientationLock.LANDSCAPE_LEFT
|
ScreenOrientation.OrientationLock.DEFAULT
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}, [settings, currentlyPlaying]);
|
||||||
// Cleanup function
|
|
||||||
return () => {
|
|
||||||
// Cancel any subscriptions or timers if you have any
|
|
||||||
// clearTimeout(timerId);
|
|
||||||
// unsubscribe();
|
|
||||||
};
|
|
||||||
}, [currentlyPlaying, settings]);
|
|
||||||
|
|
||||||
if (!api || !currentlyPlaying) return null;
|
if (!api || !currentlyPlaying) return null;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user