fix(#ios): ios player fix

pull/288/head
Rakov 2 years ago
parent bd218b8888
commit bef03ff120
  1. 23
      src/features/StreamPlayer/hooks/index.tsx

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

Loading…
Cancel
Save