fix: preload=auto, artwork pre-warm, AbortError reload (matching Kima Hub)

- Add preload="auto" playsinline to <audio> element: browser starts
  buffering as soon as src is set, not only when play() is called —
  critical for background where play() has no data to work with
- Fix AbortError handling: instead of silently returning (was swallowing
  audio element bad-state errors), reload src + load() like Kima Hub
  so the already-registered canplay listener retries play() once buffered
- Pre-warm next song's cover art in _preloadNext() using _cachedCoverUrl
  so the lock screen notification never cold-starts artwork on first skip
- Move _coverCache to top of file so _preloadNext and updateMediaSession
  share the same stable token URLs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-05-03 23:09:46 +02:00
1 parent a0c6d09c41
commit 0344dcdcb6
2 files changed
+29 -13

No files matched your search

+1 -1
View File
@@ -590,7 +590,7 @@
<div class="jobs-panel" id="jobs-panel"></div>
<div class="toast-container" id="toast-container"></div>
<audio id="audio-element"></audio>
<audio id="audio-element" preload="auto" playsinline></audio>
<audio id="preview-audio"></audio>
<audio id="abs-audio"></audio>