In Exoplayer version 2.14.1
Playerd.EventListener()
is deprecated. when I read docs its says use instead of Player.Listener
, but I have no idea how to use that method like below code.
simpleExoPlayer.addListener(new Player.EventListener() {
@Override
public void onPlaybackStateChanged(int state) {
if (state == simpleExoPlayer.STATE_READY) {
aspectRatioFrameLayout.setAspectRatio(16f / 9f);
} else {
playerView.hideController();
}
}
});
As per there Documentation you would want something like:
simpleExoPlayer.addListener(new Player.Listener() {
@Override
public void onPlaybackStateChanged(@State int state) {
if (state == Player.STATE_READY) {
aspectRatioFrameLayout.setAspectRatio(16f / 9f);
} else {
playerView.hideController();
}
}
});