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.