Listen to playWhenReady changes in LeanbackPlayerAdapter
#minor-release Issue: google/ExoPlayer#10420 PiperOrigin-RevId: 460223064
This commit is contained in:
parent
05e728a31e
commit
4eb34e4c58
@ -32,6 +32,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)
|
||||
|
||||
|
@ -236,11 +236,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();
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user