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 Hls from 'hls.js'
import { isIOS, KEYBOARD_KEYS } from 'config' import {
isIOS,
isMobileDevice,
KEYBOARD_KEYS,
} from 'config'
import { import {
useObjectState, useObjectState,
@ -601,13 +605,13 @@ export const useVideoPlayer = ({
}, [setPlayerState]) }, [setPlayerState])
useEffect(() => { useEffect(() => {
if (ready && videoRef && !isPlayingEpisode) { if (ready && videoRef && !isMobileDevice) {
videoRef.current?.scrollIntoView({ videoRef.current?.scrollIntoView({
behavior: 'smooth', behavior: 'smooth',
block: 'start', block: 'start',
}) })
} }
}, [ready, videoRef, isPlayingEpisode]) }, [ready, videoRef])
useEffect(() => { useEffect(() => {
setCircleAnimation((state) => ({ setCircleAnimation((state) => ({

Loading…
Cancel
Save