kopia lustrzana https://github.com/TeamNewPipe/NewPipe
Handling play/pause button from different headsets
rodzic
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);
|
||||
|
|
Ładowanie…
Reference in New Issue