Skip to content

Commit

Permalink
Merge pull request #20 from mikmikmik/main
Browse files Browse the repository at this point in the history
Allow for android devices not using ACTION_PLAY_PAUSE to work
  • Loading branch information
jofr authored Mar 14, 2024
2 parents 839fa6e + fac4b1a commit 44cb830
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ public void connectAndInitialize(MediaSessionPlugin plugin, Intent intent) {
}

notificationActions.put("play", new NotificationCompat.Action(
R.drawable.ic_baseline_play_arrow_24, "Play", MediaButtonReceiver.buildMediaButtonPendingIntent(this, PlaybackStateCompat.ACTION_PLAY_PAUSE)
R.drawable.ic_baseline_play_arrow_24, "Play", MediaButtonReceiver.buildMediaButtonPendingIntent(this, (PlaybackStateCompat.ACTION_PLAY_PAUSE | PlaybackStateCompat.ACTION_PLAY))
));
notificationActions.put("pause", new NotificationCompat.Action(
R.drawable.ic_baseline_pause_24, "Pause", MediaButtonReceiver.buildMediaButtonPendingIntent(this, PlaybackStateCompat.ACTION_PLAY_PAUSE)
R.drawable.ic_baseline_pause_24, "Pause", MediaButtonReceiver.buildMediaButtonPendingIntent(this, (PlaybackStateCompat.ACTION_PLAY_PAUSE | PlaybackStateCompat.ACTION_PAUSE))
));
notificationActions.put("seekbackward", new NotificationCompat.Action(
R.drawable.ic_baseline_replay_30_24, "Previous Track", MediaButtonReceiver.buildMediaButtonPendingIntent(this, PlaybackStateCompat.ACTION_REWIND)
Expand All @@ -138,8 +138,8 @@ public void connectAndInitialize(MediaSessionPlugin plugin, Intent intent) {

playbackStateActions.put("previoustrack", PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS);
playbackStateActions.put("seekbackward", PlaybackStateCompat.ACTION_REWIND);
playbackStateActions.put("play", PlaybackStateCompat.ACTION_PLAY_PAUSE);
playbackStateActions.put("pause", PlaybackStateCompat.ACTION_PLAY_PAUSE);
playbackStateActions.put("play", (PlaybackStateCompat.ACTION_PLAY_PAUSE | PlaybackStateCompat.ACTION_PLAY));
playbackStateActions.put("pause", (PlaybackStateCompat.ACTION_PLAY_PAUSE | PlaybackStateCompat.ACTION_PAUSE));
playbackStateActions.put("seekforward", PlaybackStateCompat.ACTION_FAST_FORWARD);
playbackStateActions.put("nexttrack", PlaybackStateCompat.ACTION_SKIP_TO_NEXT);
playbackStateActions.put("seekto", PlaybackStateCompat.ACTION_SEEK_TO);
Expand Down

0 comments on commit 44cb830

Please sign in to comment.