Update web/src/lib/components/asset-viewer/VideoNativeViewer.svelte

Co-authored-by: Mees Frensel <33722705+meesfrensel@users.noreply.github.com>
This commit is contained in:
Mert
2026-05-11 12:46:56 -04:00
committed by mertalev
parent f93c167f68
commit 2f1de18d4f
@@ -177,7 +177,6 @@
api.on(Hls.Events.FRAG_LOADED, () => (rebuildCount = 0)); api.on(Hls.Events.FRAG_LOADED, () => (rebuildCount = 0));
api.on(Hls.Events.ERROR, (_, data) => { api.on(Hls.Events.ERROR, (_, data) => {
console.error('HLS error', JSON.stringify(data));
// 404 on a fragment can mean the server-side session has expired. Refetch // 404 on a fragment can mean the server-side session has expired. Refetch
// master for a new session, but give up if it still 404s. // master for a new session, but give up if it still 404s.
if ( if (
@@ -186,8 +185,10 @@
data.response?.code !== 404 || data.response?.code !== 404 ||
rebuildCount++ >= MAX_REBUILDS rebuildCount++ >= MAX_REBUILDS
) { ) {
console.error('HLS error', JSON.stringify(data));
return; return;
} }
console.warn('Error loading segment, starting new session');
activeSession = undefined; activeSession = undefined;
resumeTime = el.currentTime; resumeTime = el.currentTime;
el.load(); el.load();