mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-03-11 17:45:38 +00:00
subtitle size reset fix
This commit is contained in:
parent
532d6fb8a0
commit
ff4b8f9bbc
2 changed files with 13 additions and 2 deletions
|
|
@ -264,6 +264,7 @@ const AndroidVideoPlayer: React.FC = () => {
|
|||
const [brightness, setBrightness] = useState(1.0);
|
||||
const [showVolumeOverlay, setShowVolumeOverlay] = useState(false);
|
||||
const [showBrightnessOverlay, setShowBrightnessOverlay] = useState(false);
|
||||
const [subtitleSettingsLoaded, setSubtitleSettingsLoaded] = useState(false);
|
||||
const volumeOverlayOpacity = useRef(new Animated.Value(0)).current;
|
||||
const brightnessOverlayOpacity = useRef(new Animated.Value(0)).current;
|
||||
const volumeOverlayTimeout = useRef<NodeJS.Timeout | null>(null);
|
||||
|
|
@ -2455,12 +2456,15 @@ const AndroidVideoPlayer: React.FC = () => {
|
|||
if (typeof saved.subtitleLineHeightMultiplier === 'number') setSubtitleLineHeightMultiplier(saved.subtitleLineHeightMultiplier);
|
||||
if (typeof saved.subtitleOffsetSec === 'number') setSubtitleOffsetSec(saved.subtitleOffsetSec);
|
||||
}
|
||||
} catch {}
|
||||
} catch {} finally {
|
||||
try { setSubtitleSettingsLoaded(true); } catch {}
|
||||
}
|
||||
})();
|
||||
}, []);
|
||||
|
||||
// Persist global subtitle settings on change
|
||||
useEffect(() => {
|
||||
if (!subtitleSettingsLoaded) return;
|
||||
storageService.saveSubtitleSettings({
|
||||
subtitleSize,
|
||||
subtitleBackground,
|
||||
|
|
@ -2490,6 +2494,7 @@ const AndroidVideoPlayer: React.FC = () => {
|
|||
subtitleLetterSpacing,
|
||||
subtitleLineHeightMultiplier,
|
||||
subtitleOffsetSec,
|
||||
subtitleSettingsLoaded,
|
||||
]);
|
||||
|
||||
const increaseSubtitleSize = () => {
|
||||
|
|
|
|||
|
|
@ -252,6 +252,7 @@ const VideoPlayer: React.FC = () => {
|
|||
const [brightness, setBrightness] = useState(1.0);
|
||||
const [showVolumeOverlay, setShowVolumeOverlay] = useState(false);
|
||||
const [showBrightnessOverlay, setShowBrightnessOverlay] = useState(false);
|
||||
const [subtitleSettingsLoaded, setSubtitleSettingsLoaded] = useState(false);
|
||||
const volumeOverlayOpacity = useRef(new Animated.Value(0)).current;
|
||||
const brightnessOverlayOpacity = useRef(new Animated.Value(0)).current;
|
||||
const volumeOverlayTimeout = useRef<NodeJS.Timeout | null>(null);
|
||||
|
|
@ -2104,12 +2105,16 @@ const VideoPlayer: React.FC = () => {
|
|||
if (typeof saved.subtitleLineHeightMultiplier === 'number') setSubtitleLineHeightMultiplier(saved.subtitleLineHeightMultiplier);
|
||||
if (typeof saved.subtitleOffsetSec === 'number') setSubtitleOffsetSec(saved.subtitleOffsetSec);
|
||||
}
|
||||
} catch {}
|
||||
} catch {} finally {
|
||||
// Mark subtitle settings as loaded so we can safely persist subsequent changes
|
||||
try { setSubtitleSettingsLoaded(true); } catch {}
|
||||
}
|
||||
})();
|
||||
}, []);
|
||||
|
||||
// Persist global subtitle settings on change
|
||||
useEffect(() => {
|
||||
if (!subtitleSettingsLoaded) return;
|
||||
storageService.saveSubtitleSettings({
|
||||
subtitleSize,
|
||||
subtitleBackground,
|
||||
|
|
@ -2139,6 +2144,7 @@ const VideoPlayer: React.FC = () => {
|
|||
subtitleLetterSpacing,
|
||||
subtitleLineHeightMultiplier,
|
||||
subtitleOffsetSec,
|
||||
subtitleSettingsLoaded,
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue