jQuery.noConflict();
(function($) {
$(function() {
$(document).ready(function() {
// jPlayer code
$('a.music-player').each(function(i, a) {
var $a = $(a);
if ($a.attr('href')) {
var markup = '
';
markup += '
';
markup += '
play';
markup += '
pause';
markup += '
';
// Replace the a with the new markup.
$a.before(markup).remove();
$('#jquery_jplayer' + i).jPlayer({
customCssIds: true,
swfPath: "https://www.apbif.fr/wp-content/plugins/fs-music-albums/",
ready: function () {
this.element.jPlayer("setFile", $a.attr('href'));
}
})
.jPlayer("cssId", "play", 'jplayer_play' + i)
.jPlayer("cssId", "pause", 'jplayer_pause' + i);
// Clicking the play button sould stop all the other players.
$('#jplayer_play' + i).click(function() {
$('.player:not(#jquery_jplayer' + i + ')').jPlayer("stop");
});
}
});
});
});
})(jQuery);