fix(#616): player scrollIntoView

pull/207/head
Rakov 3 years ago
parent 0697dbf072
commit e3332c4e3f
  1. 10
      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) => ({

Loading…
Cancel
Save