How to do it...

Here are the instructions:

  1. Create a blank Ionic app (for example, MediaPlayer) and cd to that folder, as shown here:
$ ionic start MediaPlayer blank
$ cd MediaPlayer
  1. Install the Music Control plugin and it's Ionic Native wrapper using the following command:
$ ionic cordova plugin add cordova-plugin-music-controls$ npm install --save @ionic-native/music-controls
  1. Open ./src/pages/home/home.html and replace with the following code:
<ion-header>  <ion-navbar>    <ion-title>      Music Player    </ion-title>  </ion-navbar></ion-header><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> ...

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.