From 4712bcfd5324cc8db5f401ea62109b26277a91f9 Mon Sep 17 00:00:00 2001 From: bachinger Date: Mon, 2 Sep 2019 16:05:31 +0100 Subject: [PATCH] use isPlaying to determine which notification action to display in compact view PiperOrigin-RevId: 266782250 --- RELEASENOTES.md | 2 ++ .../android/exoplayer2/ui/PlayerNotificationManager.java | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 7d4ca0fbe0..d3cbc6b2d7 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -11,6 +11,8 @@ quality video can be loaded up to the full default buffer duration. * Bypass sniffing in `ProgressiveMediaPeriod` in case a single extractor is provided ([#6325](https://github.com/google/ExoPlayer/issues/6325)). +* Fix `PlayerNotificationManager` to show play icon rather than pause icon when + playback is ended ([#6324](https://github.com/google/ExoPlayer/issues/6324)). * Fix audio selection issue where languages are compared by bit rate ([#6335](https://github.com/google/ExoPlayer/issues/6335)). * Add `HttpDataSource.getResponseCode` to provide the status code associated diff --git a/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java b/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java index 260fb9d398..7fa4b60314 100644 --- a/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java +++ b/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java @@ -1182,10 +1182,10 @@ public class PlayerNotificationManager { if (skipPreviousActionIndex != -1) { actionIndices[actionCounter++] = skipPreviousActionIndex; } - boolean playWhenReady = player.getPlayWhenReady(); - if (pauseActionIndex != -1 && playWhenReady) { + boolean isPlaying = isPlaying(player); + if (pauseActionIndex != -1 && isPlaying) { actionIndices[actionCounter++] = pauseActionIndex; - } else if (playActionIndex != -1 && !playWhenReady) { + } else if (playActionIndex != -1 && !isPlaying) { actionIndices[actionCounter++] = playActionIndex; } if (skipNextActionIndex != -1) {