Displaying music metadata

Metadata is a piece of additional information about the song you play. Metadata can contain the name of the album, the year of its release, rating, and many other blocks of useful information.

In this section, we are going to display the following metadata when playing a music file:

  • Elapsed time
  • Remaining time
  • Cover image
  • Song name
  • Artist name

Before we start, let's learn how to deal with the song metadata. You can extract the values as follows:

<span data-amplitude-song-info="<PROPERTY>"></span>

<PROPERTY> corresponds to one of the metadata properties for the song object that we defined earlier in the player.js file:

Amplitude.init({  songs: [    {      name: 'Equilibrium I (Cello version)',      artist: 'David Hilowitz',

Get Electron Projects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.