|
|
|
|
@ -85,7 +85,9 @@ export const useVideoPlayer = ({ |
|
|
|
|
|
|
|
|
|
const chaptersDuration = useDuration(chapters) |
|
|
|
|
|
|
|
|
|
const duration = isLive ? fullMatchDuration : chaptersDuration |
|
|
|
|
const duration = (isLive && chapters[0]?.isFullMatchChapter) |
|
|
|
|
? fullMatchDuration |
|
|
|
|
: chaptersDuration |
|
|
|
|
|
|
|
|
|
const { |
|
|
|
|
onReady, |
|
|
|
|
@ -226,8 +228,6 @@ export const useVideoPlayer = ({ |
|
|
|
|
}, [playing, onPlayingChange]) |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if (isLive || isEmpty(chapters)) return |
|
|
|
|
|
|
|
|
|
setPlayerState({ |
|
|
|
|
...initialState, |
|
|
|
|
chapters: chaptersProps, |
|
|
|
|
@ -242,7 +242,7 @@ export const useVideoPlayer = ({ |
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if (isLive || isEmpty(chapters)) return |
|
|
|
|
if ((isLive && chapters[0]?.isFullMatchChapter) || isEmpty(chapters)) return |
|
|
|
|
|
|
|
|
|
const { duration: chapterDuration } = getActiveChapter() |
|
|
|
|
if (playedProgress >= chapterDuration && !seeking) { |
|
|
|
|
|