diff --git a/src/Album.js b/src/Album.js index 3660f27..7de5627 100644 --- a/src/Album.js +++ b/src/Album.js @@ -30,7 +30,7 @@ export const Album = (props) => { props.goBack(); } }} - onPlay={() => { + onCanPlay={() => { navigator.mediaSession.metadata = new MediaMetadata({ title: props.Tracks[trackNo].Title, artist: props.Artist, @@ -39,6 +39,9 @@ export const Album = (props) => { { src: makeUrl(props.Cover), sizes: '96x96' } ] }); + if (trackNo > 0) { + document.getElementById("audioElement").play(); + } }} />