A music player that connects to your cloud/distributed storage.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: re-resolve for blob-url audio

+24 -2
+19 -1
src/components/engine/audio/element.js
··· 298 298 (a) => existingMap.get(a.id)?.isPreload !== a.isPreload, 299 299 ); 300 300 301 - if (hasNewIds || hasPreloadChanges) { 301 + const hasUrlChanges = resolvedAudio.some( 302 + (a) => existingMap.get(a.id)?.url !== a.url, 303 + ); 304 + 305 + if (hasNewIds || hasPreloadChanges || hasUrlChanges) { 302 306 this.#items.value = resolvedAudio; 307 + } 308 + 309 + // When only the URL changed for an existing item (e.g. tab leadership handoff invalidated 310 + // a blob URL), the same <de-audio-item> element is reused via `keyed`. lit-html will 311 + // update <source src> but the browser won't reload on its own — call audio.load() if the 312 + // element hasn't successfully loaded yet so it picks up the fresh URL. 313 + if (hasUrlChanges && !hasNewIds) { 314 + for (const a of resolvedAudio) { 315 + if (existingMap.has(a.id) && existingMap.get(a.id)?.url !== a.url) { 316 + this.#withAudioNode(a.id, (audio) => { 317 + if (audio.readyState === 0 || audio.error) audio.load(); 318 + }); 319 + } 320 + } 303 321 } 304 322 305 323 if (args.play) this.play(args.play);
+5 -1
src/components/orchestrator/queue-audio/element.js
··· 76 76 const tracksCol = this.output?.tracks.collection(); 77 77 const tracks = tracksCol?.state === "loaded" ? tracksCol.data : undefined; 78 78 79 + // Read synchronously so leadership changes (e.g. tab takeover) re-trigger this effect. 80 + const statusPromise = this.broadcasted ? this.broadcastingStatus() : undefined; 81 + 79 82 const activeTrack = activeItem 80 83 ? tracks?.find((t) => t.id === activeItem.id) 81 84 : undefined; 82 85 83 - if ((await this.isLeader()) === false) return; 86 + const status = statusPromise ? await statusPromise : undefined; 87 + if (status && !status.leader) return; 84 88 85 89 const isPlaying = untracked(audio.isPlaying); 86 90