Skip to content

Commit

Permalink
Set all metadata in onEnded
Browse files Browse the repository at this point in the history
  • Loading branch information
jjuback committed Apr 5, 2024
1 parent d2e7910 commit 1abef23
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Album.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ export const Album = (props) => {
onEnded={() => {
if (trackNo + 1 < props.Tracks.length) {
navigator.mediaSession.metadata = new MediaMetadata({
title: props.Tracks[trackNo + 1].Title
title: props.Tracks[trackNo + 1].Title,
artist: props.Artist,
album: props.Title,
artwork: [
{ src: makeUrl(props.Cover), sizes: '96x96' }
]
});
setTrackNo(trackNo + 1);
} else {
Expand Down

0 comments on commit 1abef23

Please sign in to comment.