dimanche 26 janvier 2020

Spotify Web SDK / Web API Issues with state of current playback

I am currently using the Web Player SDK / Web Api to control spotify playback in my application. The current issue I am running into is that whenever I play a song, I cannot detect the end of the playback of the song because the

state.track_window.next_songs

when listening through

player.addListener('player_state_changed', state => { });

always has items in the "Play Queue", which causes detection almost impossible.

this: state && state.paused && state.context && state.context.metadata && state.context.metadata.uri == null typically works for, however in the case that state.track_window.next_songs has anything in it, paused is never triggered.

I am wondering if anyone has a solution for this, or if there is a way to clear our the play queue for a specific spotify player instance?

Thanks!




Aucun commentaire:

Enregistrer un commentaire