Skip to content

Commit

Permalink
removed control buttons from media notification, left only play/pause
Browse files Browse the repository at this point in the history
  • Loading branch information
geriby23 committed Jul 18, 2024
1 parent e58d864 commit 61ccaf0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions android/src/main/kotlin/com/jhomlala/better_player/BetterPlayer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ import androidx.media3.ui.PlayerNotificationManager
}
}

playerNotificationManager = PlayerNotificationManager.Builder(
val playerNotificationManager = PlayerNotificationManager.Builder(
context,
NOTIFICATION_ID,
DEFAULT_NOTIFICATION_CHANNEL // Use the notification channel ID
Expand All @@ -293,7 +293,15 @@ import androidx.media3.ui.PlayerNotificationManager
})
.build()

playerNotificationManager?.setPlayer(exoPlayer)
// Enable only the play/pause action
playerNotificationManager.setUsePlayPauseActions(true)
playerNotificationManager.setUseRewindAction(false)
playerNotificationManager.setUseFastForwardAction(false)
playerNotificationManager.setUsePreviousAction(false)
playerNotificationManager.setUseNextAction(false)
playerNotificationManager.setUseStopAction(false)

playerNotificationManager.setPlayer(exoPlayer)
notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
}

Expand Down

0 comments on commit 61ccaf0

Please sign in to comment.