Use metadata or HTML files to display artwork and track names on the iPhone lock screen

When you lock iphone after using safari / chrome etc. when the mp3 file is playing, it displays blank illustrations and a hard link to the location of the mp3 file, which looks pretty ugly. Are there any alt tags / metadata that I can include to show the artwork and title of the track on this?

+1
source share
2 answers

You can add a line that will be displayed on the iOS locked screen by setting the title attribute to your <audio> element. All this is on the β€œsong” line, so it does not look completely native, but it gets your point.

However, I do not know how to persuade iOS to display album art from a browser.

+6
source

If you want to display an image on the lock screen from your page, you cannot do this, only iOS applications. If you want to play music in the background (while the safari is closed, not killed), you can do it like this:

 var mp3 = document.createElement("audio"); mp3.setAttribute('src', 'http://example.com/track.mp3'); mp3.load(); document.documentElement.appendChild(mp3); mp3.play(); mp3.pause() // Pause 
0
source

Source: https://habr.com/ru/post/1271248/


All Articles