渐进式生成播放:fMP4 前 4 个分片就绪即返回播放列表开始起播,后台边转边补 ENDLIST,消除整集封装等待的黑屏缓冲

This commit is contained in:
yvan
2026-09-18 16:06:31 +08:00
parent 3f8c29b7e2
commit f3546ab2db
7 changed files with 170 additions and 57 deletions
+1 -1
View File
@@ -653,7 +653,7 @@
statusText.textContent = '正在缓冲…';
await mediaLoader.load(result, supportsNativePlayback(), signal, offset);
if (signal.aborted || version !== streamVersion) throw abortError();
if (Number.isFinite(video.duration) && video.duration > 0) playbackDuration = video.duration;
if (Number.isFinite(video.duration) && video.duration > playbackDuration) playbackDuration = video.duration;
if (offset > 0) video.currentTime = playbackDuration > 0 ? Math.min(offset, Math.max(0, playbackDuration - 0.05)) : offset;
video.playbackRate = Number(node('playbackRate').value) || 1;
loading = false;