Some simplifications/improvements to the mediaService facilitating background playback on Android:
Use a regular Service instead of a MediaBrowserService. The browser service was private anyway, so no external apps could connect to it. It also prohibits any other browser service to be implemented by the hosting app, as there can be only one registered MediaBrowserService.
Remove the notification when the player's source is unset (undefined).
Remove the need for MediaButtonReceiver broadcast receiver and intent listener: as of API 21+, all media buttons are routed to the active media session. And we do not want the background service to be (re)started if the app was closed, so there is no need for theMediaButtonReceiver helper.
Some simplifications/improvements to the mediaService facilitating background playback on Android:
Service
instead of aMediaBrowserService
. The browser service was private anyway, so no external apps could connect to it. It also prohibits any other browser service to be implemented by the hosting app, as there can be only one registered MediaBrowserService.MediaButtonReceiver
broadcast receiver and intent listener: as of API 21+, all media buttons are routed to the active media session. And we do not want the background service to be (re)started if the app was closed, so there is no need for theMediaButtonReceiver
helper.