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
Error Installing SQLite3 Gem via Bundler
Cocoon Add Association, How to Limit Number of Associations
Best Way to Split Arrays into Multiple Small Arrays in Ruby
Cannot Assign Requested Address - Bind(2) (Errno::Eaddrnotavail)
How to Batch Convert Mp4 Files to Ogg with Ffmpeg Using a Bash Command or Ruby
Bundler - Load Multiple Gemfiles
Install Nokogiri 1.6.1 Under Ruby 2.0.0P353 (Rvm Based Installation) Fails (Osx Mavericks)
Ruby Regex Gsub a Line in a Text File
Does the Order of Gems in Your Gemfile Make a Difference
How to Specify the Location of the Chromedriver Binary
Remove Subdomain from String in Ruby
Is Regexp.Last_Match Thread Safe
Save All Image Files from a Website
Creating a Setter Method That Takes Extra Arguments in Ruby