From e3332c4e3f689ce68b7a5fa62c58f05257651b03 Mon Sep 17 00:00:00 2001 From: Rakov Date: Tue, 23 May 2023 13:34:29 +0300 Subject: [PATCH] fix(#616): player scrollIntoView --- src/features/StreamPlayer/hooks/index.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/features/StreamPlayer/hooks/index.tsx b/src/features/StreamPlayer/hooks/index.tsx index b70c5f4a..485528dc 100644 --- a/src/features/StreamPlayer/hooks/index.tsx +++ b/src/features/StreamPlayer/hooks/index.tsx @@ -20,7 +20,11 @@ import values from 'lodash/values' import Hls from 'hls.js' -import { isIOS, KEYBOARD_KEYS } from 'config' +import { + isIOS, + isMobileDevice, + KEYBOARD_KEYS, +} from 'config' import { useObjectState, @@ -601,13 +605,13 @@ export const useVideoPlayer = ({ }, [setPlayerState]) useEffect(() => { - if (ready && videoRef && !isPlayingEpisode) { + if (ready && videoRef && !isMobileDevice) { videoRef.current?.scrollIntoView({ behavior: 'smooth', block: 'start', }) } - }, [ready, videoRef, isPlayingEpisode]) + }, [ready, videoRef]) useEffect(() => { setCircleAnimation((state) => ({