Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×

Play jukebox playlist from API

Hi, How does one play a playlist in the jukebox using the API? I know there are mods like Roll20AM, but I'm looking to play the playlist "for real". As in, when I click the play button in the UI I can see the playlist is playing. That's what I want to control from a script. I see there is a playJukeboxPlaylist function that would do the right thing, but it seems to be related to no longer in use SoundCloud functionality. I'm not sure why it doesn't work with the current jukebox functionality Roll20 provides, as the API shape should be the same. Thanks!
1770729592

Edited 1770730579
Also, is it possible to update the Jukebox Playlist documentation to be clearer that playJukeboxPlaylist and stopJukeboxPlaylist are no longer available? The page says "Note: Using SoundCloud functions will not throw errors, but they no longer do anything.", and I thought that was referring to a bunch of SoundCloud functions that were no longer listed on the page at all. Seeing as our game is currently setup with a jukebox, with playlists, with playlist IDs and I had never even heard of SoundCloud + Roll20 together, I thought&nbsp;playJukeboxPlaylist and&nbsp;stopJukeboxPlaylist would still work. I was surprised to find they had any relation to the paragraph above discussing SoundCloud. The "In Regards to SoundCloud" link is also broken, which adds to the confusion. <a href="https://wiki.roll20.net/API:Utility_Functions#Jukebox_Playlists" rel="nofollow">https://wiki.roll20.net/API:Utility_Functions#Jukebox_Playlists</a> Edit: I see the "official" docs are in a worse state and make no mention of these functions not working at all:&nbsp;<a href="https://help.roll20.net/hc/en-us/articles/360037256774-API-Utility-Functions#API:UtilityFunctions-JukeboxPlaylists" rel="nofollow">https://help.roll20.net/hc/en-us/articles/360037256774-API-Utility-Functions#API:UtilityFunctions-JukeboxPlaylists</a>
1770738431

Edited 1770738627
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Check out Jukebox Plus . It's a Graphic User Interface for playing Roll20 audio that shows or announces the currently playing track, allows both playlists and ad hoc "albums". It also allows for controlling mixes and soundscapes, plus a lot more. It can be used out of the box, or customized to your heart's delight. But if you are looking to script your own solution, you can read the track IDs from a playlist, and cycle through them. There are change events for when tracks start and stop that you can cue off of.
1770738785

Edited 1770738880
Does it work with the existing Roll20 UI? That's what I'm trying to accomplish. As in if I play a playlist I also see that playlist start playing in the UI itself. So if I would see the "Anhkeg" playlist play button turn to a stop button when I start the playlist from a script. And then I could press that stop button in the UI and have it work properly.
1770745956
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Based on those criteria, I don't think so. Like you noticed, there is no "Play Playlist" event or command. The only thing the API notices is tracks starting and stopping. It is obvious in the Jukebox Plus interface that a playlist is playing, though. It's really a total replacement for the normal interface. The video link in the referenced thread should give you an idea.
1770746326

Edited 1770746401
Thanks, that's what I figured. I was hoping to work with the UI, and not against it, but it seems Roll20 makes that impossible. I'll check out your mod and look at integrating it into the scripts/macros I write for our GM, since there's no need for me to reinvent the world. Thanks for the link! Still hoping they'll fix the docs cuz I was pretty excited to find just the function I needed, only to realize it's not even real.
1770749424
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Yeah, nobody likes writing documentation. :D