/SimpleMediaPlaybackService

A reference implementation of the media service for Android

Primary LanguageKotlin

Download

What?

Simple Music Service that is able to stream a simple audio stream to be used like a radio player. (Studio Brussels and MNM from VRT)
No metadata is (yet) included.

The used player is ExoMedia, but any player would do.

The following list of specs are required by Android best practices.
This is the current state of the service:

  • The service is started as a foreground service which means a notification is shown during music playback. ✔️
  • The notification can not be swiped away whilst music is playing ✔️
  • The notification can be swiped away when music is paused/stopped ✔️
  • The service should be killed when the notification is swiped away ❌ [Delete Intent does not fire?]
  • The notification should show the current play back state of the service (play/pause) ✔️
  • When clicking on a notification it should open the app ✔️
  • When the activity is killed the notification should still be shown and music should still play ✔️
  • When an audio jack is plugged in while audio is playing and it disconnects, music playback should pause. ✔️
  • When a user opens up another music app the service should stop playing music. ✔️
  • When a user receives a notification (with sound) the music should lower the volume temporarily ✔️
  • When a user receives a call the service should stop playing ✔️
  • When the user opens up another music app the music player should pause. ✔️

How?

implementation 'be.rijckaert.tim:simple-media-playback-service:${Version}'

See sample folder for a full sample.