Bug description
When showNotificationControls is enabled, VideoPlaybackService.onUpdateNotification() calls startForeground() with a notification but never creates a NotificationChannel. On Android 8.0+ (API 26+), this throws:
android.app.RemoteServiceException: Bad notification for startForeground
Steps to reproduce
Set showNotificationControls={true} on
A NotificationChannel should be created before startForeground() is called:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
notificationManager.createNotificationChannel(
NotificationChannel(
NOTIFICATION_CHANEL_ID,
NOTIFICATION_CHANEL_ID,
NotificationManager.IMPORTANCE_LOW
)
)
}
startForeground(mediaSession.player.hashCode(), buildNotification(mediaSession))
Platform: Android 8.0+ (API 26+)
Version: 6.10.2
Bug description
When showNotificationControls is enabled, VideoPlaybackService.onUpdateNotification() calls startForeground() with a notification but never creates a NotificationChannel. On Android 8.0+ (API 26+), this throws:
android.app.RemoteServiceException: Bad notification for startForegroundSteps to reproduce
Set showNotificationControls={true} on
A NotificationChannel should be created before startForeground() is called:
Platform: Android 8.0+ (API 26+)
Version: 6.10.2