diff --git a/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java b/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java index dbf27ea7c..4eaa2a73b 100644 --- a/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java @@ -341,6 +341,7 @@ public final class BackgroundPlayer extends Service { @Override public void handleIntent(final Intent intent) { super.handleIntent(intent); + resetNotification(); if (bigNotRemoteView != null) bigNotRemoteView.setProgressBar(R.id.notificationProgressBar, 100, 0, false); diff --git a/app/src/main/java/org/schabi/newpipe/player/BasePlayer.java b/app/src/main/java/org/schabi/newpipe/player/BasePlayer.java index adffefa6e..a71671e7b 100644 --- a/app/src/main/java/org/schabi/newpipe/player/BasePlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/BasePlayer.java @@ -332,7 +332,7 @@ public abstract class BasePlayer implements if (playQueueAdapter != null) playQueueAdapter.dispose(); playQueueAdapter = new PlayQueueAdapter(context, playQueue); - if (isMuted) simpleExoPlayer.setVolume(0); + simpleExoPlayer.setVolume(isMuted ? 0 : 1); } public void destroyPlayer() { diff --git a/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java index 63d95e74f..d74a739cf 100644 --- a/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java @@ -401,12 +401,7 @@ public final class MainVideoPlayer extends AppCompatActivity } protected void setMuteButton(final ImageButton muteButton, final boolean isMuted) { - if (isMuted) { - muteButton.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.white)); - } else { - muteButton.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.gray)); - - } + muteButton.setColorFilter(ContextCompat.getColor(getApplicationContext(), isMuted ? R.color.white : R.color.gray)); } diff --git a/app/src/main/java/org/schabi/newpipe/player/ServicePlayerActivity.java b/app/src/main/java/org/schabi/newpipe/player/ServicePlayerActivity.java index c0a8d2bfd..10b202e4c 100644 --- a/app/src/main/java/org/schabi/newpipe/player/ServicePlayerActivity.java +++ b/app/src/main/java/org/schabi/newpipe/player/ServicePlayerActivity.java @@ -687,11 +687,6 @@ public abstract class ServicePlayerActivity extends AppCompatActivity } private void onMaybeMuteChanged(){ - if (player.isMuted()) { - muteButton.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.white)); - } - else { - muteButton.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.gray)); - } + muteButton.setColorFilter(ContextCompat.getColor(getApplicationContext(), player.isMuted() ? R.color.white : R.color.gray)); } }