Stop the last song from restarting and freezing service-mode lyrics

This commit is contained in:
Jonathan Sykes
2026-10-07 02:12:07 +08:00
parent 128f8e95e3
commit 2b286ae146
3 changed files with 11 additions and 1 deletions

View File

@@ -18,7 +18,8 @@
pending.set(element, request); return request;
}
function resume(element, clock) {
if (!element || !element.paused || pending.has(element)) return;
// An ended element is finished, not interrupted: play() would restart it from 0.
if (!element || !element.paused || element.ended || pending.has(element)) return;
if (clock && element !== clock && needsAlignment(element.currentTime, clock.currentTime)) element.currentTime = clock.currentTime;
return play(element);
}