I have implemented exoplayer notification manager and wanted to detect play or pause action so that I can update UI accordingly to it
I have tried this code
`
player.addListener(new Player.DefaultEventListener() {
@Override
public void onPlayerStateChanged(boolean playWhenReady, int playbackState) {
if (playWhenReady && playbackState == Player.STATE_READY) {
// media actually playing
} else if (playWhenReady) {
// might be idle (plays after prepare()),
// buffering (plays when data available)
// or ended (plays when seek away from end)
} else {
// player paused in any state
}
}
});
`
which I got from here - https://stackoverflow.com/a/48067205/13312583
but its not working is there any method to this thing ?