I am attempting to make an app that receives a URL via an intent and then plays the audio in the background, providing play/pause functionality through an 'ongoing' notification.
I have looked at similar examples like the following: How to put media controller button on notification bar? and Music player implementation in android.
The two above attempt to achieve similar things to what I need, however I need something that is a combination of the two. In order to play the audio in the background I believe I require a service but I am unsure then how I can also create the notification and send play/pause/stop requests with it back to the service.
How can I make a simple media player that receives a URL and then plays it in the background leaving a way to play/pause and stop it via a notification?
Thank you, Daniel
Aucun commentaire:
Enregistrer un commentaire