push
This commit is contained in:
+5
-3
@@ -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 }
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user