Fix: Robust metadata refresh
This commit is contained in:
parent
6669c6854a
commit
fc53295ced
1 changed files with 5 additions and 1 deletions
|
|
@ -205,7 +205,6 @@ export class Player {
|
|||
document.title = `${trackTitle} • ${getTrackArtists(track)}`;
|
||||
|
||||
this.updatePlayingTrackIndicator();
|
||||
this.updateMediaSession(track);
|
||||
|
||||
try {
|
||||
let streamUrl;
|
||||
|
|
@ -228,6 +227,8 @@ export class Player {
|
|||
}
|
||||
await this.audio.play();
|
||||
|
||||
// Update Media Session AFTER play starts to ensure metadata is captured
|
||||
this.updateMediaSession(track);
|
||||
this.updateMediaSessionPlaybackState();
|
||||
this.preloadNextTracks();
|
||||
} catch (error) {
|
||||
|
|
@ -468,6 +469,9 @@ export class Player {
|
|||
updateMediaSession(track) {
|
||||
if (!('mediaSession' in navigator)) return;
|
||||
|
||||
// Force a refresh for picky Bluetooth systems by clearing metadata first
|
||||
navigator.mediaSession.metadata = null;
|
||||
|
||||
const artwork = [];
|
||||
const sizes = ['320'];
|
||||
const coverId = track.album?.cover;
|
||||
|
|
|
|||
Loading…
Reference in a new issue