|
|
|
@ -202,19 +202,22 @@ export const useVideoPlayer = ({ |
|
|
|
|
|
|
|
|
|
|
|
const chaptersDuration = useDuration(chapters) |
|
|
|
const chaptersDuration = useDuration(chapters) |
|
|
|
|
|
|
|
|
|
|
|
const duration = useMemo(() => (( |
|
|
|
const duration = useMemo(() => { |
|
|
|
isLive |
|
|
|
if (isLive && chapters[0]?.isFullMatchChapter) { |
|
|
|
&& chapters[0]?.isFullMatchChapter |
|
|
|
if (isIOS) { |
|
|
|
&& Number.isFinite(videoRefDurationMs) |
|
|
|
return fullMatchDuration - getActiveChapter().startOffsetMs |
|
|
|
) |
|
|
|
} if (Number.isFinite(videoRefDurationMs)) { |
|
|
|
? videoRefDurationMs - getActiveChapter().startOffsetMs |
|
|
|
return videoRefDurationMs - getActiveChapter().startOffsetMs |
|
|
|
: chaptersDuration |
|
|
|
} |
|
|
|
), [ |
|
|
|
} |
|
|
|
|
|
|
|
return chaptersDuration |
|
|
|
|
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
|
|
|
|
|
|
}, [ |
|
|
|
chapters, |
|
|
|
chapters, |
|
|
|
chaptersDuration, |
|
|
|
chaptersDuration, |
|
|
|
|
|
|
|
fullMatchDuration, |
|
|
|
getActiveChapter, |
|
|
|
getActiveChapter, |
|
|
|
isLive, |
|
|
|
isLive, |
|
|
|
videoRefDurationMs, |
|
|
|
|
|
|
|
]) |
|
|
|
]) |
|
|
|
|
|
|
|
|
|
|
|
const { |
|
|
|
const { |
|
|
|
@ -688,7 +691,7 @@ export const useVideoPlayer = ({ |
|
|
|
buffering, |
|
|
|
buffering, |
|
|
|
chapters, |
|
|
|
chapters, |
|
|
|
currentPlayingOrder, |
|
|
|
currentPlayingOrder, |
|
|
|
duration: duration || videoRefDurationMs, |
|
|
|
duration, |
|
|
|
isFirstChapterPlaying, |
|
|
|
isFirstChapterPlaying, |
|
|
|
isFullscreen, |
|
|
|
isFullscreen, |
|
|
|
isLastChapterPlaying, |
|
|
|
isLastChapterPlaying, |
|
|
|
|