Commit 4eb34e4c by christosts Committed by Rohit Singh

Listen to playWhenReady changes in LeanbackPlayerAdapter

#minor-release

Issue: google/ExoPlayer#10420
PiperOrigin-RevId: 460223064
parent 05e728a3
...@@ -32,6 +32,9 @@ ...@@ -32,6 +32,9 @@
* RTSP: * RTSP:
* Add RTP reader for H263 * Add RTP reader for H263
([#63](https://github.com/androidx/media/pull/63)). ([#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) ### 1.0.0-beta01 (2022-06-16)
......
...@@ -237,11 +237,6 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab ...@@ -237,11 +237,6 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
// Player.Listener implementation. // Player.Listener implementation.
@Override @Override
public void onPlaybackStateChanged(@Player.State int playbackState) {
notifyStateChanged();
}
@Override
public void onPlayerError(PlaybackException error) { public void onPlayerError(PlaybackException error) {
Callback callback = getCallback(); Callback callback = getCallback();
if (errorMessageProvider != null) { if (errorMessageProvider != null) {
...@@ -285,5 +280,13 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab ...@@ -285,5 +280,13 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
int scaledWidth = Math.round(videoSize.width * videoSize.pixelWidthHeightRatio); int scaledWidth = Math.round(videoSize.width * videoSize.pixelWidthHeightRatio);
getCallback().onVideoSizeChanged(LeanbackPlayerAdapter.this, scaledWidth, videoSize.height); 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