This commit is contained in:
4DBug
2026-08-26 18:28:49 -05:00
parent 9e93df5961
commit 145851a32e
15 changed files with 1215 additions and 272 deletions
+5 -3
View File
@@ -89,7 +89,9 @@
function load(stream, opts = {}) {
const st = capture();
if (typeof opts.resumeAt === 'number' && opts.resumeAt > 10) st.time = opts.resumeAt;
const explicitResume = typeof opts.resumeAt === 'number' && opts.resumeAt > 10;
if (typeof opts.resumeAt === 'number') st.time = Math.max(0, opts.resumeAt);
const readyAt = () => (explicitResume ? st.time : 0);
teardown();
networkRetry = false;
@@ -126,7 +128,7 @@
h.attachMedia(video);
h.on(Hls.Events.MANIFEST_PARSED, guarded(() => {
restore(st);
onReady(st.time > 10 ? st.time : 0);
onReady(readyAt());
}));
h.on(Hls.Events.ERROR, (evt, data) => {
if (myToken !== token || !data.fatal) return;
@@ -155,7 +157,7 @@
'loadedmetadata',
guarded(() => {
restore(st);
onReady(st.time > 10 ? st.time : 0);
onReady(readyAt());
}),
{ once: true }
);