Populate jPlayer playlist from MySQL database
To populate a jPlayer playlist from a MySQL database you can use the following sample code. You need to have jQuery and jPlayer loaded.
STEP 1
Insert the following PHP code before placement of the playlist HTML. The while
loop extracts the wanted records from the database and builds up the playlist as a Json array.
STEP 2
Now you can activate the player with the playlist data ready to go. Copy and paste the jQuery script code after the above PHP code. For more details on jPlayer configuration parameters, visit the jPlayer Web site.
STEP 3
Copy and paste the jPlayer HTML code after the above jQuery code. Don't forget to have the jPlayer CSS stylesheet loaded and adjust this as is desired.