Creating a media player with the Media Player notification control
Media Player is an important app in a user's phone. Almost every media app has a control in the notification area nowadays. In this recipe, we are going to create a very simple media player with Play and Pause buttons and we will add Media Player controls in the notification area.
This is what the home page of our app will look like:

And this is what the notification area will look like:

When the user clicks on the Play button inside the app, it shows controls in the notification area. When the user clicks on the Pause button inside the app, it updates the music controls too. This also works the other way around. You can play and pause the media from Music Control in the notification area.
Getting ready
You should have a physical device ready in order to test this app, since it uses the Cordova plugin.
How to do it...
Here are the instructions:
- Create a blank Ionic app (for example,
MediaPlayer
) andcd
to that folder, as shown here...