mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-31 07:38:39 +00:00
refactor: logic
This commit is contained in:
parent
a0796371de
commit
abe42467ad
1 changed files with 7 additions and 4 deletions
|
|
@ -462,13 +462,16 @@ const Player = ({ urlParams, queryParams }) => {
|
|||
}, []);
|
||||
|
||||
React.useEffect(() => {
|
||||
const controlBarLayerHeight = Math.round((controlBarRef?.current?.offsetHeight / window?.innerHeight) * 100);
|
||||
if(controlBarRef.current !== null && video.state.subtitlesOffset < controlBarLayerHeight && controlBarLayerHeight !== null) {
|
||||
let controlBarLayerHeight = Math.round((controlBarRef?.current?.offsetHeight / window?.innerHeight) * 100);
|
||||
|
||||
if(video.state.subtitlesOffset < controlBarLayerHeight / 2) {
|
||||
if (immersed) controlBarLayerHeight = 0;
|
||||
updateSettings({ subtitlesOffset: video.state.subtitlesOffset + controlBarLayerHeight });
|
||||
} else if (controlBarRef.current.offsetHeight === null || controlBarRef.current.offsetHeight === 0) {
|
||||
} else {
|
||||
controlBarLayerHeight = Math.round((controlBarRef?.current?.offsetHeight / window?.innerHeight) * 100);
|
||||
updateSettings({ subtitlesOffset: video.state.subtitlesOffset - controlBarLayerHeight });
|
||||
}
|
||||
}, [controlBarRef, video.state.subtitlesOffset]);
|
||||
}, [immersed]);
|
||||
|
||||
React.useLayoutEffect(() => {
|
||||
const onKeyDown = (event) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue