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 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,

Loading…
Cancel
Save