mirror of
https://github.com/androidx/media.git
synced 2025-05-16 12:09:50 +08:00
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.
This commit is contained in:
parent
535e14cb4d
commit
8d2406ece3
@ -946,7 +946,9 @@ public final class MediaSessionConnector {
|
||||
@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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user