From 97c7bcbc2e092e0475c7895cc95ce5f92011389d Mon Sep 17 00:00:00 2001 From: Pas <74743263+Pasithea0@users.noreply.github.com> Date: Sat, 18 Jan 2025 23:15:16 -0700 Subject: [PATCH] update error exclusions to list format --- src/components/player/display/base.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/player/display/base.ts b/src/components/player/display/base.ts index 7964d3e8..c1ec707b 100644 --- a/src/components/player/display/base.ts +++ b/src/components/player/display/base.ts @@ -149,6 +149,9 @@ export function makeVideoElementDisplayInterface(): DisplayInterface { throw new Error("HLS not supported. Update your browser. 🤦‍♂️"); if (!hls) { hls = new Hls({ + lowLatencyMode: true, + backBufferLength: 120, + autoStartLoad: true, maxBufferSize: 500 * 1000 * 1000, // 500 mb of buffering, should load more fragments at once fragLoadPolicy: { default: { @@ -168,13 +171,15 @@ export function makeVideoElementDisplayInterface(): DisplayInterface { }, renderTextTracksNatively: false, }); - hls.on(Hls.Events.ERROR, (event, data) => { + const exceptions = [ + "Failed to execute 'appendBuffer' on 'SourceBuffer': This SourceBuffer has been removed from the parent media source.", + ]; + hls?.on(Hls.Events.ERROR, (event, data) => { console.error("HLS error", data); if ( data.fatal && src?.url === data.frag?.baseurl && - data.error.message !== - "Failed to execute 'appendBuffer' on 'SourceBuffer': This SourceBuffer has been removed from the parent media source." + !exceptions.includes(data.error.message) ) { emit("error", { message: data.error.message,