Album art not showing when using AudioPlaybackAgen

2019-08-30 06:51发布

问题:

when using the AudioPlaybackAgent in WP7 I create a track before playing it. Now when I create the track everything transfers: the file, the title, the artist, and the album, but for some reason when I navigate to the Music and Video Hub on the phone the AlbumArt never shows up.

Here's my code:

AudioTrack audioTrack = new AudioTrack();
audioTrack.BeginEdit();
audioTrack.Source = new Uri(track.Attribute("source").Value);
audioTrack.Title = track.Attribute("title").Value;
audioTrack.Artist = track.Attribute("artist").Value;
audioTrack.Album = track.Attribute("album").Value;
audioTrack.AlbumArt = new Uri(track.Attribute("albumArt").Value);
audioTrack.EndEdit();

NOTE: The track.Attribute is just extracting the values from an xml file. I did debug this and the correct paths are in there and all data is being returned just fine. Any idea why It isn't showing up? Is this even possible?

回答1:

Is the image present in the isolated storage under the shared/media directory?

As per MSDN:

If you copy the image file into isolated storage under the shared/media directory and set this property, the album art will automatically be displayed in the Now Playing tile in the Music + Videos Hub.