mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-11 17:30:00 +02:00
feat(player): increase buffering and stability for HLS and MPEG-TS
This commit is contained in:
1 parent
b8682eafe0
commit
9e97f45046
2 files changed
+26
-22
No files matched your search
+12
-8
@@ -253,18 +253,18 @@
|
||||
const isTurbo = urlParams.get('turbo') === 'true';
|
||||
|
||||
const hls = new Hls({
|
||||
maxBufferLength: 60,
|
||||
maxBufferLength: 120,
|
||||
enableWorker: true,
|
||||
liveSyncDurationCount: 5, // Balanced for desktop
|
||||
nudgeOffset: 0.2,
|
||||
nudgeMaxRetries: 10,
|
||||
maxLiveSyncPlaybackRate: 1.1,
|
||||
liveSyncDurationCount: 10, // Increased for desktop stability
|
||||
nudgeOffset: 0.4,
|
||||
nudgeMaxRetries: 15,
|
||||
maxLiveSyncPlaybackRate: 1.15,
|
||||
// Turbo-Start specific
|
||||
startLevel: isTurbo ? 0 : -1,
|
||||
initialLiveManifestSize: 1,
|
||||
abrEwmaDefaultEstimate: 500000,
|
||||
manifestLoadingRetryDelay: 800,
|
||||
levelLoadingRetryDelay: 800
|
||||
manifestLoadingRetryDelay: 1000,
|
||||
levelLoadingRetryDelay: 1000
|
||||
});
|
||||
window.hlsInstance = hls;
|
||||
hls.loadSource(url);
|
||||
@@ -290,7 +290,11 @@
|
||||
log('Trying mpegts.js with: ' + url);
|
||||
showLoading('Chargement MPEG-TS...');
|
||||
if (!mpegts.isSupported()) return false;
|
||||
const player = mpegts.createPlayer({ type: 'mpegts', isLive: isLive, url: url }, { enableWorker: true, stashInitialSize: 1024 * 1024 });
|
||||
const player = mpegts.createPlayer({ type: 'mpegts', isLive: isLive, url: url }, {
|
||||
enableWorker: true,
|
||||
stashInitialSize: 512 * 1024,
|
||||
maxStashSize: 20 * 1024 * 1024 // 20MB buffer capacity
|
||||
});
|
||||
player.attachMediaElement(video);
|
||||
player.load();
|
||||
player.play().catch(() => playOverlay.style.display = 'flex');
|
||||
|
||||
+14
-14
@@ -245,22 +245,22 @@
|
||||
const isTurbo = urlParams.get('turbo') === 'true';
|
||||
|
||||
const hls = new Hls({
|
||||
maxBufferLength: 60, // Increased for stability
|
||||
maxMaxBufferLength: 120,
|
||||
maxBufferLength: 120, // Doubled for stability
|
||||
maxMaxBufferLength: 240,
|
||||
enableWorker: true,
|
||||
liveSyncDurationCount: 6, // More distance from live edge (TiviMate style)
|
||||
liveMaxLatencyDurationCount: 20,
|
||||
lowLatencyMode: true,
|
||||
liveSyncDurationCount: 12, // Increased distance from live edge (TiviMate style) for high latency
|
||||
liveMaxLatencyDurationCount: 40,
|
||||
lowLatencyMode: false, // Disabled for better stability on laggy connections
|
||||
// Robustness features
|
||||
nudgeOffset: 0.2, // Jump over discontinuities
|
||||
nudgeMaxRetries: 10,
|
||||
maxLiveSyncPlaybackRate: 1.1, // Smooth catch-up
|
||||
nudgeOffset: 0.5, // Jump over discontinuities more aggressively
|
||||
nudgeMaxRetries: 20,
|
||||
maxLiveSyncPlaybackRate: 1.2, // Smooth catch-up
|
||||
// Turbo-Start specific
|
||||
startLevel: isTurbo ? 0 : -1,
|
||||
initialLiveManifestSize: 1,
|
||||
abrEwmaDefaultEstimate: 500000,
|
||||
manifestLoadingRetryDelay: 800,
|
||||
levelLoadingRetryDelay: 800
|
||||
manifestLoadingRetryDelay: 1000,
|
||||
levelLoadingRetryDelay: 1000
|
||||
});
|
||||
|
||||
window.hlsInstance = hls;
|
||||
@@ -296,14 +296,14 @@
|
||||
url: url
|
||||
}, {
|
||||
enableWorker: true,
|
||||
stashInitialSize: isTurbo ? 1024 * 1024 : 1024 * 1024, // 1MB Large buffer for everyone
|
||||
stashInitialSize: 512 * 1024,
|
||||
enableStashBuffer: true,
|
||||
liveBufferLatencyChasing: true,
|
||||
liveBufferLatencyChasingOnPaused: true,
|
||||
liveBufferLatencyMaxLatency: 3.0, // Safety margin
|
||||
liveBufferLatencyMinLatency: 1.0,
|
||||
liveBufferLatencyMaxLatency: 10.0,
|
||||
liveBufferLatencyMinLatency: 2.0,
|
||||
lazyLoad: false,
|
||||
maxStashSize: 2 * 1024 * 1024 // 2MB Max
|
||||
maxStashSize: 20 * 1024 * 1024
|
||||
});
|
||||
|
||||
player.attachMediaElement(video);
|
||||
|
||||
Reference in new issue
Block a user