Treat playback after stop as a new playback

This implies we should report it as STATE_JOINING_FOREGROUND
instead of STATE_BUFFERING.

PiperOrigin-RevId: 627406584
This commit is contained in:
tonihei 2024-04-23 09:06:29 -07:00 committed by Copybara-Service
parent 73f614b14d
commit bf9f8a3719

View File

@ -455,7 +455,8 @@ public final class MediaMetricsListener
return PlaybackStateEvent.STATE_ENDED;
} else if (playerPlaybackState == Player.STATE_BUFFERING) {
if (currentPlaybackState == PlaybackStateEvent.STATE_NOT_STARTED
|| currentPlaybackState == PlaybackStateEvent.STATE_JOINING_FOREGROUND) {
|| currentPlaybackState == PlaybackStateEvent.STATE_JOINING_FOREGROUND
|| currentPlaybackState == PlaybackStateEvent.STATE_STOPPED) {
return PlaybackStateEvent.STATE_JOINING_FOREGROUND;
}
if (!player.getPlayWhenReady()) {