How it works...

First, let's take a look at the template home.html:

<ion-content padding>    <ion-item>       <ion-thumbnail item-left>        <img src="{{track.art}}">      </ion-thumbnail>      <div item-content style="width:100%">        <p><strong>{{track.title}}</strong> ⚬ <em>{{track.artist}}</em>      </p>      </div>    </ion-item>    <ion-row id="music-controls">      <ion-col (click)="play()"><ion-icon name="play"></ion-icon></ion-col>      <ion-col (click)="pause()"><ion-icon name="pause"></ion-icon></ion-col>    </ion-row></ion-content>

It is very simple. We are showing the track's thumbnail and track title along with the track artist in ion-item. Then we have the play and pause buttons, shown inside ion-row.

At home.ts, we have a list of audio tracks for our media player. For the sake ...

Get Ionic Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.