Skip to content

Fixed infinite loading of stop image - #3

Open
hazzy159 wants to merge 1 commit into
audioguidekit:devfrom
hazzy159:artwork-fix
Open

hazzy159 wants to merge 1 commit into
audioguidekit:devfrom
hazzy159:artwork-fix

Conversation

@hazzy159

Copy link
Copy Markdown

In useMediaSessionIntegration.ts on every state update, a new artwork array was being created. The library's useMediaMeta treated this as a metadata change and re-published MediaMetadata, which caused the browser to request the image again. In Network the initiator was use-media-session.js.

I memoized the array by the stop's image URL. I checked in the browser: after Play/Pause toggles, the metadata with the cover was not reassigned again, and the number of requests to the stop's image did not increase. When the stop changes, the URL changes, so its cover updates as expected.

In useMediaSessionIntegration.ts on every state update, a new artwork array was being created. The library's useMediaMeta treated this as a metadata change and re-published MediaMetadata, which caused the browser to request the image again. In Network the initiator was use-media-session.js.

I memoized the array by the stop's image URL. I checked in the browser: after Play/Pause toggles, the metadata with the cover was not reassigned again, and the number of requests to the stop's image did not increase. When the stop changes, the URL changes, so its cover updates as expected.
@vercel

vercel Bot commented Sep 28, 2026

Copy link
Copy Markdown

@hazzy159 is attempting to deploy a commit to the michalacler-gmailcom's projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant