mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-24 09:00:31 +00:00
Fix crash when playing stream in background with shuffle in notification
This commit is contained in:
parent
caf7c55069
commit
6de03f2bf0
@ -351,7 +351,7 @@ public final class NotificationUtil {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "shuffle":
|
case "shuffle":
|
||||||
if (basePlayerImpl.playQueue.isShuffled()) {
|
if (basePlayerImpl.playQueue != null && basePlayerImpl.playQueue.isShuffled()) {
|
||||||
builder.addAction(R.drawable.exo_controls_shuffle_on, "ShuffleOn",
|
builder.addAction(R.drawable.exo_controls_shuffle_on, "ShuffleOn",
|
||||||
PendingIntent.getBroadcast(context, NOTIFICATION_ID_BACKGROUND,
|
PendingIntent.getBroadcast(context, NOTIFICATION_ID_BACKGROUND,
|
||||||
new Intent(BackgroundPlayer.ACTION_SHUFFLE),
|
new Intent(BackgroundPlayer.ACTION_SHUFFLE),
|
||||||
@ -601,7 +601,7 @@ public final class NotificationUtil {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "shuffle":
|
case "shuffle":
|
||||||
if (basePlayerImpl.playQueue.isShuffled()) {
|
if (basePlayerImpl.playQueue != null && basePlayerImpl.playQueue.isShuffled()) {
|
||||||
notificationBuilder.mActions.set(slotNumber,
|
notificationBuilder.mActions.set(slotNumber,
|
||||||
new NotificationCompat.Action(R.drawable.exo_controls_shuffle_on,
|
new NotificationCompat.Action(R.drawable.exo_controls_shuffle_on,
|
||||||
"ShuffleOn", PendingIntent.getBroadcast(context,
|
"ShuffleOn", PendingIntent.getBroadcast(context,
|
||||||
@ -835,7 +835,7 @@ public final class NotificationUtil {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "shuffle":
|
case "shuffle":
|
||||||
if (playerImpl.playQueue.isShuffled()) {
|
if (playerImpl.playQueue != null && playerImpl.playQueue.isShuffled()) {
|
||||||
builder.addAction(R.drawable.exo_controls_shuffle_on, "ShuffleOn",
|
builder.addAction(R.drawable.exo_controls_shuffle_on, "ShuffleOn",
|
||||||
PendingIntent.getBroadcast(context, NOTIFICATION_ID_POPUP,
|
PendingIntent.getBroadcast(context, NOTIFICATION_ID_POPUP,
|
||||||
new Intent(PopupVideoPlayer.ACTION_SHUFFLE),
|
new Intent(PopupVideoPlayer.ACTION_SHUFFLE),
|
||||||
@ -1080,7 +1080,7 @@ public final class NotificationUtil {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "shuffle":
|
case "shuffle":
|
||||||
if (playerImpl.playQueue.isShuffled()) {
|
if (playerImpl.playQueue != null && playerImpl.playQueue.isShuffled()) {
|
||||||
notificationBuilder.mActions.set(slotNumber,
|
notificationBuilder.mActions.set(slotNumber,
|
||||||
new NotificationCompat.Action(R.drawable.exo_controls_shuffle_on,
|
new NotificationCompat.Action(R.drawable.exo_controls_shuffle_on,
|
||||||
"ShuffleOn", PendingIntent.getBroadcast(context,
|
"ShuffleOn", PendingIntent.getBroadcast(context,
|
||||||
|
Loading…
Reference in New Issue
Block a user