Commit 8d2406ec by Dennis Fölster

Keep the paused state during buffering without playWhenReady.

The PlaybackStateCompat#STATE_BUFFERING expects the playback to begin
once enough data has been buffered. This is however not the case if
playWhenReady is not set on the exoplayer.
parent 535e14cb
...@@ -946,7 +946,9 @@ public final class MediaSessionConnector { ...@@ -946,7 +946,9 @@ public final class MediaSessionConnector {
@Player.State int exoPlayerPlaybackState, boolean playWhenReady) { @Player.State int exoPlayerPlaybackState, boolean playWhenReady) {
switch (exoPlayerPlaybackState) { switch (exoPlayerPlaybackState) {
case Player.STATE_BUFFERING: case Player.STATE_BUFFERING:
return PlaybackStateCompat.STATE_BUFFERING; return playWhenReady
? PlaybackStateCompat.STATE_BUFFERING
: PlaybackStateCompat.STATE_PAUSED;
case Player.STATE_READY: case Player.STATE_READY:
return playWhenReady ? PlaybackStateCompat.STATE_PLAYING : PlaybackStateCompat.STATE_PAUSED; return playWhenReady ? PlaybackStateCompat.STATE_PLAYING : PlaybackStateCompat.STATE_PAUSED;
case Player.STATE_ENDED: case Player.STATE_ENDED:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment