Commit 329aa586 by christosts Committed by Rohit Singh

Listen to playWhenReady changes in LeanbackPlayerAdapter

#minor-release

Issue: google/ExoPlayer#10420
PiperOrigin-RevId: 460223064
(cherry picked from commit 4eb34e4c)
parent c40d669c
......@@ -26,6 +26,9 @@
* RTSP:
* Add RTP reader for H263
([#63](https://github.com/androidx/media/pull/63)).
* Leanback extension:
* Listen to `playWhenReady` changes in `LeanbackAdapter`
([10420](https://github.com/google/ExoPlayer/issues/10420)).
### 1.0.0-beta01 (2022-06-16)
......
......@@ -237,11 +237,6 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
// Player.Listener implementation.
@Override
public void onPlaybackStateChanged(@Player.State int playbackState) {
notifyStateChanged();
}
@Override
public void onPlayerError(PlaybackException error) {
Callback callback = getCallback();
if (errorMessageProvider != null) {
......@@ -285,5 +280,13 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
int scaledWidth = Math.round(videoSize.width * videoSize.pixelWidthHeightRatio);
getCallback().onVideoSizeChanged(LeanbackPlayerAdapter.this, scaledWidth, videoSize.height);
}
@Override
public void onEvents(Player player, Player.Events events) {
if (events.containsAny(
Player.EVENT_PLAY_WHEN_READY_CHANGED, Player.EVENT_PLAYBACK_STATE_CHANGED)) {
notifyStateChanged();
}
}
}
}
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