use isPlaying to determine which notification action to display in compact view

PiperOrigin-RevId: 266782250
This commit is contained in:
bachinger 2019-09-02 16:05:31 +01:00 committed by Oliver Woodman
parent 284a672bb3
commit 4712bcfd53
2 changed files with 5 additions and 3 deletions

View File

@ -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

View File

@ -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) {