diff --git a/Makefile b/Makefile index fcd82d60..9e38ef85 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,7 @@ patch-external: patch -p1 -N < patches/scroller-perf.patch || true patch -p1 -N < patches/scroller-sticky.patch || true patch -p1 -N < patches/plyr-wrap.patch || true + patch -p1 -N < patches/videojs-vhs-1439.patch || true watch-js: npm run watch diff --git a/patches/videojs-vhs-1439.patch b/patches/videojs-vhs-1439.patch new file mode 100644 index 00000000..8e10d79a --- /dev/null +++ b/patches/videojs-vhs-1439.patch @@ -0,0 +1,13 @@ +--- ./node_modules/video.js/dist/video.es.js 2023-10-27 02:56:03.617235084 -0700 ++++ ./node_modules/video.js/dist/video.es.js 2023-10-27 02:55:57.048971664 -0700 +@@ -48232,7 +48232,9 @@ + + resetMainLoaderReplaceSegments() { + const buffered = this.tech_.buffered(); +- const bufferedEnd = buffered.end(buffered.length - 1); // Set the replace segments flag to the buffered end, this forces fetchAtBuffer ++ // https://github.com/videojs/http-streaming/pull/1439 ++ const bufferedEnd = buffered.length ? buffered.end(buffered.length - 1) : 0; ++ // Set the replace segments flag to the buffered end, this forces fetchAtBuffer + // on the main loader to remain, false after the resetLoader call, until we have + // replaced all content buffered ahead of the currentTime. + diff --git a/src/components/viewer/PsVideo.ts b/src/components/viewer/PsVideo.ts index 4d09e34a..1f74face 100644 --- a/src/components/viewer/PsVideo.ts +++ b/src/components/viewer/PsVideo.ts @@ -424,6 +424,7 @@ class VideoContentSetup { // Changing the quality sometimes throws strange // DOMExceptions when initializing; don't let this stop // Plyr from being constructed altogether. + // https://github.com/videojs/http-streaming/pull/1439 try { const qualityList = content.videojs?.qualityLevels?.(); if (!qualityList || !content.videojs) return;