jxnblk / plangular

Create custom SoundCloud players with HTML & CSS
http://jxnblk.github.io/plangular
480 stars 93 forks source link

Updating current track title in playlist #17

Closed lukephills closed 10 years ago

lukephills commented 10 years ago

Hi how can I get the current playing track from the playlist example - not the playlist title.

Just using {{ track.title }} doesn't do anything. Any easy way to do this without lots of js?

Thanks

jxnblk commented 10 years ago

player.playing and player.paused are the currently playing and paused tracks. player.tracks[player.i] should give you the currently loaded track, if I remember correctly.

scottwvw commented 9 years ago

Hi jxnblk,

Forgive me for missing the obvious but I can't seem to get this to work, is there a code snippet to show the current track from a playlist (whether playing or paused)?

Also, thanks so much for the plugin, defo the best out there for me, just need this last bit to mean I can use it!

Thanks

Scott

jxnblk commented 9 years ago

I think the API has changed in the latest version. This should work to show the currently playing track title: {{tracks[index].title}} where {{tracks[index]}} is the currently playing track.

scottwvw commented 9 years ago

Aha, worked liked a charm, thanks!