I’m developing a rails web app for school that would allow users to add songs to a playlist and then invite other users to up/down vote songs in the queue.
I’m trying to figure out if the SoundCloud API has the tools necessary to do this. Basically I have a list of songs (and their correspond SoundCloud track id) indexed by votes. I’d like the player to play the song on top of the list each time a song complets, so that songs are played according to order.
I’ve considered using SoundCloud playlists but I don’t think I can dynamically modify the order of songs in a playlist. Any suggestions would be greatly appreciated!
What we ended up doing is using soundclouds event listeners and ajax to make streaming possible. We have a list of songs that users can up/down vote (the queue). When the start event is fired off, we mark the song as played and pop it off the top of the queue. When the finished event is fired off, we load up the song that is now at the top of the queue and play.
There are some issues with our implementation because the start event corresponds with pressing the play button (not just a song starting for a first time). As a result, each time a user pauses a song and then presses play again, the song that is at the top of the queue is popped off and marked as played.