Listen to playWhenReady changes in LeanbackPlayerAdapter
#minor-release Issue: google/ExoPlayer#10420 PiperOrigin-RevId: 460223064 (cherry picked from commit c43d9f5b5794e5019758ee7df68f79ed9f9bc4a7)
This commit is contained in:
parent
43eb3d0fc8
commit
36a99cb1d3
@ -234,11 +234,6 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
|
|||||||
|
|
||||||
// Player.Listener implementation.
|
// Player.Listener implementation.
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPlaybackStateChanged(@Player.State int playbackState) {
|
|
||||||
notifyStateChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPlayerError(PlaybackException error) {
|
public void onPlayerError(PlaybackException error) {
|
||||||
Callback callback = getCallback();
|
Callback callback = getCallback();
|
||||||
@ -283,5 +278,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();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user