From bec1b74208245bec2bff4bb7f3cb57fc34bc6411 Mon Sep 17 00:00:00 2001 From: Trevor Mears Date: Wed, 31 Dec 2025 01:07:47 -0800 Subject: [PATCH] Remove seeking logic from play method --- public/js/components/VideoPlayer.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/public/js/components/VideoPlayer.js b/public/js/components/VideoPlayer.js index 97fcebb..2577428 100644 --- a/public/js/components/VideoPlayer.js +++ b/public/js/components/VideoPlayer.js @@ -386,23 +386,17 @@ class VideoPlayer { } }); - // Detect discontinuity changes (ad transitions) and help decoder reset + // Detect discontinuity changes (ad transitions) for logging only this.lastDiscontinuity = -1; this.hls.on(Hls.Events.FRAG_CHANGED, (event, data) => { const frag = data.frag; if (frag && frag.sn !== 'initSegment') { - // Check if we crossed a discontinuity boundary using CC (Continuity Counter) + // Log discontinuity changes for debugging if (frag.cc !== undefined && frag.cc !== this.lastDiscontinuity) { - const wasFirstDetection = this.lastDiscontinuity === -1; console.log(`[HLS] Discontinuity detected: CC ${this.lastDiscontinuity} -> ${frag.cc}`); this.lastDiscontinuity = frag.cc; - - // Skip on first detection (initial load) - if (!wasFirstDetection && !this.video.paused && this.video.currentTime > 0) { - // Seek forward slightly to skip past any corrupted audio frames - console.log('[HLS] Seeking past discontinuity boundary'); - this.video.currentTime += 1; - } + // Note: maxAudioFramesDrift: 4 handles audio sync naturally + // No manual seeking needed - it can cause more issues than it solves } } });