fix: stabilize IPTV playback and implement request throttling

- Add playback lock to XtreamService to delay EPG during stream init
- Increase MPEG-TS stash buffer to 512KB for better stability
- Enable liveBufferLatencyChasing to prevent stream drift
- Tune HLS parameters for balanced speed and reliability
This commit is contained in:
Michael committed 2026-03-10 18:54:44 +01:00
1 parent 0ca6f96710
commit df4bcfd07f
5 files changed
+48 -22

No files matched your search

+4 -4
View File
@@ -253,15 +253,15 @@
const isTurbo = urlParams.get('turbo') === 'true';
const hls = new Hls({
maxBufferLength: isTurbo ? 30 : 45,
maxBufferLength: isTurbo ? 45 : 50,
enableWorker: true,
liveSyncDurationCount: isTurbo ? 2 : 4,
liveSyncDurationCount: isTurbo ? 3 : 4, // Improved stability
// Turbo-Start specific
startLevel: isTurbo ? 0 : -1,
initialLiveManifestSize: 1,
abrEwmaDefaultEstimate: 500000,
manifestLoadingRetryDelay: 500,
levelLoadingRetryDelay: 500
manifestLoadingRetryDelay: 800,
levelLoadingRetryDelay: 800
});
window.hlsInstance = hls;
hls.loadSource(url);
+14 -11
View File
@@ -245,18 +245,18 @@
const isTurbo = urlParams.get('turbo') === 'true';
const hls = new Hls({
maxBufferLength: isTurbo ? 30 : 60,
maxMaxBufferLength: isTurbo ? 60 : 120,
maxBufferLength: isTurbo ? 45 : 60,
maxMaxBufferLength: isTurbo ? 90 : 120,
enableWorker: true,
liveSyncDurationCount: isTurbo ? 2 : 5, // Aggressive sync for Turbo
liveMaxLatencyDurationCount: isTurbo ? 10 : 15,
liveSyncDurationCount: isTurbo ? 3 : 5, // Improved stability
liveMaxLatencyDurationCount: isTurbo ? 15 : 20,
lowLatencyMode: true,
// Turbo-Start specific
startLevel: isTurbo ? 0 : -1, // Lowest bitrate first
startLevel: isTurbo ? 0 : -1,
initialLiveManifestSize: 1,
abrEwmaDefaultEstimate: 500000, // Start with conservative estimate
manifestLoadingRetryDelay: 500,
levelLoadingRetryDelay: 500
abrEwmaDefaultEstimate: 500000,
manifestLoadingRetryDelay: 800,
levelLoadingRetryDelay: 800
});
window.hlsInstance = hls;
@@ -292,9 +292,12 @@
url: url
}, {
enableWorker: true,
stashInitialSize: isTurbo ? 128 * 1024 : 512 * 1024, // Tiny stash for Turbo zapping
enableStashBuffer: !isTurbo, // Direct pass-through for Live TV Turbo
lazyLoad: false
stashInitialSize: isTurbo ? 512 * 1024 : 1024 * 1024, // 512KB for better stability
enableStashBuffer: true, // Re-enable stash buffer for stability
liveBufferLatencyChasing: true, // Correct drift
liveBufferLatencyChasingOnPaused: true,
lazyLoad: false,
maxStashSize: 1024 * 1024 // 1MB Max
});
player.attachMediaElement(video);
+7 -7
View File
@@ -231,18 +231,18 @@
const isTurbo = urlParams.get('turbo') === 'true';
const hls = new Hls({
maxBufferLength: isTurbo ? 30 : 60,
maxMaxBufferLength: isTurbo ? 60 : 120,
liveSyncDurationCount: isTurbo ? 2 : 5,
liveMaxLatencyDurationCount: isTurbo ? 10 : 15,
maxBufferLength: isTurbo ? 45 : 60,
maxMaxBufferLength: isTurbo ? 90 : 120,
liveSyncDurationCount: isTurbo ? 3 : 5, // Improved stability
liveMaxLatencyDurationCount: isTurbo ? 15 : 20,
enableWorker: true,
lowLatencyMode: !isTurbo, // Prioritize stability unless Turbo requested
lowLatencyMode: true,
// Turbo-Start specific
startLevel: isTurbo ? 0 : -1,
initialLiveManifestSize: 1,
abrEwmaDefaultEstimate: 500000,
manifestLoadingRetryDelay: 500,
levelLoadingRetryDelay: 500
manifestLoadingRetryDelay: 800,
levelLoadingRetryDelay: 800
});
hls.loadSource(streamUrl);
hls.attachMedia(video);