← Back to Upcase

How to Integrate JQuery Player In Rails


(Jude Igboanugo) #1

I am creating music application in raills. For the music player I am using JQuery player, but since I am barely a beginner when it comes to javascript I am having issues generating the play list dynamically from the database. Any help on this will be greatly appreciated.


(Chad Pytel) #2

Hi @judeigboanugo,

I’ve taken a look at jplayer, and it looks like ti just plays one file at a time. So at a high level, to accomplish what you want, you’re going to want to output a list of the s3 files into a JavaScript array. Then you’re going to have jPlayer play through that array of urls.

However, it looks like there is a jPlayer add-on that provides this functionality automatically. You can get it here: http://www.jplayer.org/latest/demo-02-jPlayerPlaylist/

Using this, you’ll be able to give the player your array of songs.

Let me know if you run into further trouble, thanks,
-Chad