I am trying to implement ExoPlayer's Notification Manager
, it works pretty well but I do not want to show fast rewind and fast forward buttons. I checked documentation but can not find a way to hide these button. Is there any tricky way to hide them?
Here is my code
private fun initListener() {
val playerNotificationManager: PlayerNotificationManager
val notificationId = 1234
val mediaDescriptionAdapter = object : PlayerNotificationManager.MediaDescriptionAdapter {
override fun getCurrentSubText(player: Player?): String {
return "Sub text"
}
override fun getCurrentContentTitle(player: Player): String {
return "Title"
}
override fun createCurrentContentIntent(player: Player): PendingIntent? {
return null
}
override fun getCurrentContentText(player: Player): String {
return "ContentText"
}
override fun getCurrentLargeIcon(
player: Player,
callback: PlayerNotificationManager.BitmapCallback
): Bitmap? {
return null
}
}
playerNotificationManager = PlayerNotificationManager.createWithNotificationChannel(
context,
"My_channel_id",
R.string.app_name,
notificationId,
mediaDescriptionAdapter,
object : PlayerNotificationManager.NotificationListener {
override fun onNotificationPosted(notificationId: Int, notification: Notification, ongoing: Boolean) {}
override fun onNotificationCancelled(notificationId: Int, dismissedByUser: Boolean) {}
})
playerNotificationManager.setUseNavigationActions(false)
playerNotificationManager.setUseNavigationActionsInCompactView(false)
playerNotificationManager.setVisibility(View.VISIBLE)
playerNotificationManager.setPlayer(mPlayer)
}