Skip to content

Commit

Permalink
videojs: fix startup exception
Browse files Browse the repository at this point in the history
videojs/http-streaming#1439
Signed-off-by: Varun Patil <[email protected]>
  • Loading branch information
pulsejet committed Oct 27, 2023
1 parent e4b8f21 commit 2ad35bf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions patches/videojs-vhs-1439.patch
Original file line number Diff line number Diff line change
@@ -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.

1 change: 1 addition & 0 deletions src/components/viewer/PsVideo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2ad35bf

Please sign in to comment.