onPlayerStateChanged it's not called when a playlist change from one song to another
Why would you expect it to change? One of the key selling points of playlist support in V2 is that we can perform transitions seamlessly, which means there wont be any changes to player state across the transition ;). You should probably be looking at onPositionDiscontinuity instead, which is invoked on seeks and also when transitioning from one song to the next.
i would like to refresh my UI when the song on the playlist change
Yes. So use onPositionDiscontinuity. From there, you can use ExoPlayer.getCurrentWindowIndex to see the index of the track being played. If it's changed then you can refresh the UI accordingly.
Thx :)
Most helpful comment
Yes. So use
onPositionDiscontinuity. From there, you can useExoPlayer.getCurrentWindowIndexto see the index of the track being played. If it's changed then you can refresh the UI accordingly.