Changing Songs on Jplayer by Clicking a Link, Hosted on Amazon S3

Changing songs on jPlayer by clicking a link, hosted on Amazon S3

Well it appears that the only issue was a lack of brackets around the mp3: url part of jPlayer("setMedia"....

so it should have been (...).jPlayer("setMedia", {mp3: url}).(...)

how to dynamically pass songs to jPlayer?

Have you tried this?

$("#jquery_jplayer_1").jPlayer("setMedia", {mp3: url}).jPlayer("play");

Pulled from:
Changing songs on jPlayer by clicking a link, hosted on Amazon S3

How to parametrize setMedia in jPlayer?

Edit: Your question was about how to print a variable, but it seems that you actually want to figure out how to setMedia of a jPlayer

Check out this link http://www.jplayer.org/latest/developer-guide/#jPlayer-setMedia

$("#jquery_jplayer_1").jPlayer( {
ready: function() {
$(this).jPlayer( "setMedia", {
mp3: "yourpath/movie.mp3"
});
},
supplied: "mp3"
);

In your case all you have to do is move $music to the right scope. Like so:

$(document).ready(function(){
var music = $(".album-playlist li").first().find("input").val();
$("#jquery_jplayer_1").jPlayer( {
ready: function() {
$(this).jPlayer( "setMedia", {
mp3: music
});
},
supplied: "mp3"
);
$("#jquery_jplayer_1").append("Mp3: " + music);
});

Amazon S3 - iPhone won't play private mp3

Found out that Safari will not play mp3s from a private bucket. Instead I've made the bucket public and generating expiring links for jPlayer to use



Related Topics



Leave a reply



Submit