Dynamic Playlists

rpmohn's Avatar


01 May, 2014 05:51 PM

I've been wrestling with this for a while now, so I'm finally ready to ask for help. I have a working site (not public ATM) with a basic player and a fixed JSON playlist. I also have a search box that can filters a much larger file of JSON playlist data and return a dynamically (AJAX) created JSON playlist. What I haven't been able to do is figure out how to get my cashmusic player to "reload" a playlist on command. I've been fussing around in soundplayer.js with stuff like cm.getJSON() and other code around there. I don't want to have to destroy and re-init the whole soundplayer, just get rid of what's currently in playlist id X and reload it with my newly generated playlist id X.

I hope I've made some sense and that you'll be able to point me in the right direction! Thanks for your awesome work! I recently got my Margaux badge from the Kickstarter :-)


  1. Support Staff 1 Posted by Jesse von Doom on 03 May, 2014 12:24 AM

    Jesse von Doom's Avatar


    There is direct script access to loading/reloading a playlist as part of a JS call. I need to look up and document the exact process — I'll pop those updates into the docs and let you know when they're in there. (Sorry that stuff didn't make it in. Done in a big hurry at a deadline, then, well...I was lame and didn't write docs.)


    Jesse von Doom

  2. 2 Posted by rpmohn on 05 May, 2014 12:54 AM

    rpmohn's Avatar

    That would be great! If I get going in the right direction I can try to help with some documentation.
    Cheers! Ross

  3. 3 Posted by rpmohn on 09 May, 2014 12:56 PM

    rpmohn's Avatar

    How about just a quick example? (I know you're busy, though!)

  4. Support Staff 4 Posted by Jesse von Doom on 09 May, 2014 05:05 PM

    Jesse von Doom's Avatar

    I promise I'll get to it. I'm sorry...leaving on a huge trip next week and trying to sort last minute details for our NYC summit. Haven't had time to dig into the code and get an example written. If not today, tomorrow...promise!


    Jesse von Doom
    @jessevondoom / (401) 864-2118

  5. 5 Posted by rpmohn on 04 Jun, 2014 12:07 PM

    rpmohn's Avatar

    Just a reminder to please take a look at this when you have a chance.
    Thanks! -Ross

  6. Support Staff 6 Posted by Jesse von Doom on 29 Jun, 2014 07:32 AM

    Jesse von Doom's Avatar

    Hey Ross,

    Okay I'm terrible at email — been pushing hard towards a new release and traveling and all kinds of dumb excuses. But...

    Check this out: https://github.com/jessevondoom/cashmusic.js

    Your question sort of triggered a landslide of refactors and bug fixes. It'll get a little more polish, but this is a pretty solid look at the next version of cashmusic.js stuff. The element embeds use a new format so they won't play nice with the current beta stuff, but I also did a bunch of work to the soundplayer stuff, and not only rewrote the flow of how we draw the UIs but also let them be a lot more dynamic.

    The index.html has commented/documented code for injecting new players dynamically with JS. There isn't a listener yet that lets you edit UI stuff on the fly, but you can trigger redraws, replace one UI with a new one, etc.

    Let me know if you have any questions, and sorry about the wait!

    (Oh and it'll get pushed to the main cashmusic/cashmusic.js repo soon...still in my own repo for another week or two probably...)


    Jesse von Doom
    @jessevondoom / (401) 864-2118

  7. Support Staff 7 Posted by Jesse von Doom on 01 Jul, 2014 06:12 PM

    Jesse von Doom's Avatar

    Marking this as closed. Responded by direct email, but short version:

    the next version of cashmusic.js makes this easy and has code samples in the documentation. It's not live yet but it's already in my own private repo at github.com/jessevondoom/cashmusic.js and will soon be live under the cashmusic account.

  8. Jesse von Doom closed this discussion on 01 Jul, 2014 06:12 PM.

  9. rpmohn re-opened this discussion on 02 Jul, 2014 02:46 PM

  10. 8 Posted by rpmohn on 02 Jul, 2014 02:46 PM

    rpmohn's Avatar

    Thanks so much, I'll check it out! -Ross

  11. Tracy closed this discussion on 03 Jul, 2014 07:27 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

12 Feb, 2020 01:59 AM
14 Jan, 2020 11:00 AM
11 Jan, 2020 04:42 PM
25 Dec, 2019 12:40 PM
13 Nov, 2019 11:28 PM