fix: typo in controlBarLayerHeight variable

This commit is contained in:
kKaskak 2024-01-10 12:25:41 +02:00
parent 0d57e220e4
commit f8aaf0e9d6

View file

@ -462,11 +462,11 @@ const Player = ({ urlParams, queryParams }) => {
}, []);
React.useEffect(() => {
const controlbarLayerHeight = Math.round((controlBarRef.current.offsetHeight / window.innerHeight) * 100);
if(controlBarRef.current !== null && video.state.subtitlesOffset < controlbarLayerHeight) {
updateSettings({ subtitlesOffset: controlbarLayerHeight });
const controlBarLayerHeight = Math.round((controlBarRef.current.offsetHeight / window.innerHeight) * 100);
if(controlBarRef.current !== null && video.state.subtitlesOffset < controlBarLayerHeight) {
updateSettings({ subtitlesOffset: controlBarLayerHeight });
} else if (controlBarRef.current === null) {
updateSettings({ subtitlesOffset: video.state.subtitlesOffset - controlbarLayerHeight });
updateSettings({ subtitlesOffset: video.state.subtitlesOffset - controlBarLayerHeight });
}
}, [controlBarRef, video.state.subtitlesOffset]);