Exoplayer: Playlist refresh UI

Created on 9 Nov 2016  路  4Comments  路  Source: google/ExoPlayer

onPlayerStateChanged it's not called when a playlist change from one song to another

question

Most helpful comment

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.

All 4 comments

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 :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

petitTrung picture petitTrung  路  3Comments

orcunkobal picture orcunkobal  路  3Comments

Ufosek picture Ufosek  路  3Comments

qeadsw picture qeadsw  路  3Comments

stari4ek picture stari4ek  路  3Comments