BVPlaybackService
Abstract base class for background playback services.
Providing PlayerConfig (choose one)
Option A (recommended): via ServicePlayerConnector.connect The config is passed in the startService Intent and used during initialization.
Option B: override onCreatePlayerConfig as a fallback Called when the Intent carries no config (e.g. on START_STICKY restart after system kill). Returns an empty PlayerConfig by default.
Required Manifest declaration
<service
android:name=".YourPlaybackService"
android:exported="true"
android:foregroundServiceType="mediaPlayback">
<intent-filter>
<action android:name="android.media.browse.MediaBrowserService" />
</intent-filter>
</service>Functions
Called when the app goes to background (from Activity.onStop, before disconnect).
Called when the app returns to the foreground (after connect succeeds in Activity.onStart).
Returns the small icon resource ID for the notification. Must be a monochrome white vector drawable.
Fallback called when the Intent carries no AnalyticsConfig. Not required if the config is always provided via ServicePlayerConnector.connect.
Returns the PendingIntent to launch when the notification is tapped. Defaults to the app's launcher Activity; override to target a specific screen.
Fallback called when the Intent carries no PlayerConfig (e.g. after a system kill + START_STICKY restart). Not required if the config is always provided via ServicePlayerConnector.connect.
Restricts MediaBrowser connections to clients within the same package by default. Override to allow external browsers (e.g. Android Auto).
Updates what the notification and the media session show for the current media.