mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-01-11 09:50:32 +00:00
Handling play/pause button from different headsets
This commit is contained in:
parent
36457400e7
commit
24f2999669
@ -591,7 +591,7 @@ public final class BackgroundPlayer extends Service {
|
||||
pendingIntent = PendingIntent.getBroadcast(context, NOTIFICATION_ID, new Intent(ACTION_PLAY_NEXT), PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
} else if (keycode == KeyEvent.KEYCODE_MEDIA_PREVIOUS) {
|
||||
pendingIntent = PendingIntent.getBroadcast(context, NOTIFICATION_ID, new Intent(ACTION_PLAY_PREVIOUS), PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
} else if (keycode == KeyEvent.KEYCODE_HEADSETHOOK) {
|
||||
} else if (keycode == KeyEvent.KEYCODE_HEADSETHOOK || keycode == KeyEvent.KEYCODE_MEDIA_PAUSE || keycode == KeyEvent.KEYCODE_MEDIA_PLAY) {
|
||||
pendingIntent = PendingIntent.getBroadcast(context, NOTIFICATION_ID, new Intent(ACTION_PLAY_PAUSE), PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
} else if (keycode == KeyEvent.KEYCODE_MEDIA_FAST_FORWARD) {
|
||||
pendingIntent = PendingIntent.getBroadcast(context, NOTIFICATION_ID, new Intent(ACTION_FAST_FORWARD), PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
|
Loading…
Reference in New Issue
Block a user