mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-18 04:39:41 +02:00
perf(player): switch to Buffer-First strategy to eliminate chaotic startup and micro-cuts
This commit is contained in:
1 parent
118887ab6f
commit
893ae7b03a
3 files changed
+69
-38
No files matched your search
+10
-8
@@ -296,19 +296,21 @@
|
||||
url: url
|
||||
}, {
|
||||
enableWorker: true,
|
||||
stashInitialSize: 256 * 1024, // Optimized Turbo Start: 256KB initial buffer
|
||||
stashInitialSize: 512 * 1024,
|
||||
enableStashBuffer: true,
|
||||
liveBufferLatencyChasing: true,
|
||||
liveBufferLatencyChasingOnPaused: true,
|
||||
liveBufferLatencyMaxLatency: 10.0,
|
||||
liveBufferLatencyMinLatency: 2.0,
|
||||
lazyLoad: false,
|
||||
maxStashSize: 20 * 1024 * 1024
|
||||
liveBufferLatencyChasing: false,
|
||||
maxStashSize: 30 * 1024 * 1024
|
||||
});
|
||||
|
||||
player.attachMediaElement(video);
|
||||
player.load();
|
||||
player.play().catch(() => playOverlay.style.display = 'flex');
|
||||
|
||||
const checkBuffer = setInterval(() => {
|
||||
if (video.buffered.length > 0 && video.buffered.end(0) > 1.0) {
|
||||
clearInterval(checkBuffer);
|
||||
player.play().catch(() => playOverlay.style.display = 'flex');
|
||||
}
|
||||
}, 200);
|
||||
|
||||
player.on(mpegts.Events.ERROR, (type, detail, info) => {
|
||||
log('MpegTS Error: ' + type + ' - ' + detail);
|
||||
|
||||
Reference in new issue
Block a user