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();
}
}
});