videojs: fix startup exception

https://github.com/videojs/http-streaming/pull/1439
Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/900/head
Varun Patil 2023-10-27 03:02:07 -07:00
parent e4b8f21b1a
commit 2ad35bfe13
3 changed files with 15 additions and 0 deletions

View File

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

View File

@ -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.

View File

@ -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;