I have a site that has particular alphanumeric ID for every song, say like 57bfab618de4191
In the jQuery player the MP3 song has to be assigned via link.
The jplayer function is this:
$(document).ready(function (){
function playAudio(val) {newVal=val}
$("#jquery_jplayer_1").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", {
mp3:"http://website.com/dlb.php?file="+newVal });
},
swfPath: "js",
supplied: "mp3",
wmode: "window"
});
});
I want to play different song present in the list for user so I passed a ID of song via button onClick
like this
onClick="playAudio(<?php echo "'".$songid. "'"; ?>)"
Where song ID is the iD of the song specified in database, like 57bfab618de4191
This way I can pass the value, but I am not able to transfer the parameter of playAudio function to the document.ready
function.