diff --git a/package-lock.json b/package-lock.json index edade4f4..b61e1f82 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39870,12 +39870,6 @@ "integrity": "sha512-MUc6zSmU3tEVnkQ78q0peeEjKWPUADMlC/t++2bI8WnAG2tvYRPIgHG8lWkXwqc8MsUF6Z2MOf+Mh5sazOmhiQ==", "dev": true }, - "@types/hls.js": { - "version": "0.13.3", - "resolved": "https://registry.npmjs.org/@types/hls.js/-/hls.js-0.13.3.tgz", - "integrity": "sha512-Po8ZPCsAcPPuf5OODPEkb6cdWJ/w4BdX1veP7IIOc2WG0x1SW4GEQ1+FHKN1AMG2AePJfNUceJbh5PKtP92yRQ==", - "dev": true - }, "@types/hoist-non-react-statics": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz", @@ -47032,13 +47026,9 @@ } }, "hls.js": { - "version": "0.14.17", - "resolved": "https://registry.npmjs.org/hls.js/-/hls.js-0.14.17.tgz", - "integrity": "sha512-25A7+m6qqp6UVkuzUQ//VVh2EEOPYlOBg32ypr34bcPO7liBMOkKFvbjbCBfiPAOTA/7BSx1Dujft3Th57WyFg==", - "requires": { - "eventemitter3": "^4.0.3", - "url-toolkit": "^2.1.6" - } + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/hls.js/-/hls.js-1.1.5.tgz", + "integrity": "sha512-mQX5TSNtJEzGo5HPpvcQgCu+BWoKDQM6YYtg/KbgWkmVAcqOCvSTi0SuqG2ZJLXxIzdnFcKU2z7Mrw/YQWhPOA==" }, "hmac-drbg": { "version": "1.0.1", diff --git a/src/features/StreamPlayer/hooks/index.tsx b/src/features/StreamPlayer/hooks/index.tsx index c26f0475..34c98f47 100644 --- a/src/features/StreamPlayer/hooks/index.tsx +++ b/src/features/StreamPlayer/hooks/index.tsx @@ -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) {