Skip to content

Commit

Permalink
Merge pull request #7367 from inv3rse:keep-paused-state-during-buffering
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 311623784
  • Loading branch information
ojw28 committed May 27, 2020
1 parent 3dc642c commit 41ae4b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
Services rather than Cronet Embedded. This allows Cronet to be used with a
negligible increase in application size, compared to approximately 8MB when
embedding the library.
* MediaSession extension: Set session playback state to BUFFERING only when
actually playing ([#7367](https://github.com/google/ExoPlayer/pull/7367),
[#7206](https://github.com/google/ExoPlayer/issues/7206)).
* DownloadService: Fix "Not allowed to start service" `IllegalStateException`.

### 2.11.4 (2020-04-08) ###
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,9 @@ private static int getMediaSessionPlaybackState(
@Player.State int exoPlayerPlaybackState, boolean playWhenReady) {
switch (exoPlayerPlaybackState) {
case Player.STATE_BUFFERING:
return PlaybackStateCompat.STATE_BUFFERING;
return playWhenReady
? PlaybackStateCompat.STATE_BUFFERING
: PlaybackStateCompat.STATE_PAUSED;
case Player.STATE_READY:
return playWhenReady ? PlaybackStateCompat.STATE_PLAYING : PlaybackStateCompat.STATE_PAUSED;
case Player.STATE_ENDED:
Expand Down

0 comments on commit 41ae4b4

Please sign in to comment.