javascriptjqueryhtmlsoundmanager2

Jump to track in BarUI playlist SoundManager2


So I've been searching all over the web for this, but didn't manage to find some propper documentation or enlightning answer. I'm trying to build a little online music player for fun and have gotten stuck on this simple task of jumping to a specific track in the BarUI playlist. For reference, here is the BarUI reference on the SoundManager2 page.

To add a little bit of detail on my particular question:

Can anybody enlighten me on how can I jump to track or play track from the playlist of the BarUI ? (I imagine it should be just a matter of knowing which functions to call, as I am able to do this manually by scrolling down to the track and clicking the play btn)

I hope it's not a very stupid question. I'll keep trying and post up the answer if I manage to come up with something useful. Thanks.


Solution

  • So after some reading and searching (found the very, very useful community forum of SoundManager2 here), I found out that the Bar UI is still a bit of a work in progress (there was no propper API yet and some features were missing).

    I ended up simulating a click event on the link added with my li track elements to the Bar UI playlist. I'm sure there must have been some way to call/expose the methods in bar-ui.js, but I found this the most straightforward way. For more complex tasks, it might be necessary to edit the bar-ui.js file directly.

    So, what I did was:

    Probably not the best way to do it, but it did the trick. Help would be appreciated though (for shuffling or programatically triggering next in the Bar UI playlist without actual interaction with the player)