|
|
|
|
@ -12,7 +12,7 @@ import { useFullscreen } from 'features/StreamPlayer/hooks/useFullscreen' |
|
|
|
|
import { useVolume } from 'features/VideoPlayer/hooks/useVolume' |
|
|
|
|
import { useNoNetworkPopupStore } from 'features/NoNetworkPopup' |
|
|
|
|
|
|
|
|
|
import { useObjectState } from 'hooks' |
|
|
|
|
import { useEventListener, useObjectState } from 'hooks' |
|
|
|
|
|
|
|
|
|
import { useProgressChangeHandler } from './useProgressChangeHandler' |
|
|
|
|
import { usePlayingHandlers } from './usePlayingHandlers' |
|
|
|
|
@ -99,6 +99,7 @@ export const useMultiSourcePlayer = ({ |
|
|
|
|
if (!videoRef.current) return |
|
|
|
|
videoRef.current.currentTime = progressMs / 1000 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const rewindForward = () => { |
|
|
|
|
const chapter = getActiveChapter() |
|
|
|
|
const newProgress = playedProgress + REWIND_SECONDS * 1000 |
|
|
|
|
@ -205,6 +206,14 @@ export const useMultiSourcePlayer = ({ |
|
|
|
|
playNextChapter, |
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
useEventListener({ |
|
|
|
|
callback: (e: KeyboardEvent) => { |
|
|
|
|
if (e.code === 'ArrowLeft') rewindBackward() |
|
|
|
|
else if (e.code === 'ArrowRight') rewindForward() |
|
|
|
|
}, |
|
|
|
|
event: 'keydown', |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const { isOnline } = useNoNetworkPopupStore() |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|