I am currently trying to make a website for a musician and he wants to have small previews of his songs of his album on the website.
I now have a JSON array with the names of the songs that I load into AngularJS and load onto the page with
<tr ng-repeat="song in info.songs">
<td>
<a href="" ng-click='startPlayback(song.url)' class="play-symbol"><span class="glyphicon glyphicon-headphones" aria-hidden="true"></a>
<a href="" ng-click='stopPlayback()' class="stop-symbol"><span class="glyphicon glyphicon-volume-off" aria-hidden="true"></a>
</td>
<td>{{song.title}}</td>
...
</tr>
As you can see I also created a "startPlayback" and "stopPlayback" which does exactly what it says.
My problem now is that I want only the "glyphicon-headphones" symbol to show up at the beginning, when I start the playback ONLY the headphone at the song I started playing changes to the "glyphicon-volume-off" symbol. I already got this far, but now I run into the problem:
I want it, so that you can now click on any other headphone("start") icon, the playback stops playing (I also already got that), the mute symbol from the "old" song that played changes back to headphones and the "new" symbol changes to the mute symbol.
How would you achieve something like that?