|
|
|
|
@ -121,7 +121,7 @@ export const useVideoPlayer = ({ |
|
|
|
|
const rewindForward = () => { |
|
|
|
|
const chapter = getActiveChapter() |
|
|
|
|
const newProgress = playedProgress + REWIND_SECONDS * 1000 |
|
|
|
|
if (newProgress <= chapter.duration) { |
|
|
|
|
if (newProgress <= chapter.duration || isLive) { |
|
|
|
|
seekTo(chapter.startOffsetMs + newProgress) |
|
|
|
|
} else if (isLastChapterPlaying) { |
|
|
|
|
playNextChapter() |
|
|
|
|
@ -158,9 +158,6 @@ export const useVideoPlayer = ({ |
|
|
|
|
|
|
|
|
|
const onWaiting = () => { |
|
|
|
|
setPlayerState({ buffering: true }) |
|
|
|
|
if (!playing) { |
|
|
|
|
setPlayerState({ buffering: false }) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const onPlaying = () => { |
|
|
|
|
@ -221,6 +218,10 @@ export const useVideoPlayer = ({ |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
onPlayingChange(playing) |
|
|
|
|
if (playing) { |
|
|
|
|
setPlayerState({ buffering: false }) |
|
|
|
|
} |
|
|
|
|
// eslint-disable-next-line
|
|
|
|
|
}, [playing, onPlayingChange]) |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|