How? Play a new song and the previous song stops

I created a playlist with a dynamic component extension, and now it works fine unless I play a new song, the old one is still playing. And I want the old song to stop when the new song is playing, please help me


Player Click

Video demo my application

and I want it to look that way

Set this block

Use block that music will not play,You got me wrong, I want to play another song then the previous song will be stopped

When you play an exoplayer, store that player id in a variable so when a new one is clicked, stop the exoplayer that is stored in the variable and play the new one.

Set when btn press exo player stop playing then set new song url then exo player start playing.

Can you give examples for this? I do not understand