ffranke/Laker-Compendium — Issue #64: MP3 Audio Will Not Play
Author: freakandgeek
Created: 2012-02-28 04:05:57+00:00
State: open

Only Ogg files will play properly.

For example:

If I take the audio player code:

// Audioplayer begin //////////////////////////////////////////////////
$("#funky-music").jPlayer({
ready: function () {
$(this).jPlayer("setMedia", {
mp3: "sounds/time-to-go.mp3",
oga: "sounds/time-to-go.ogg",
});
},
ended: function (event) {

},
swfPath: "js",
supplied: "mp3,oga",
backgroundColor: "transparent",
cssSelectorAncestor: "#jp_interface"
})

And edit to this instead (to only play Ogg)

// Audioplayer begin //////////////////////////////////////////////////
$("#funky-music").jPlayer({
ready: function () {
$(this).jPlayer("setMedia", {
oga: "sounds/time-to-go.ogg",
});
},
ended: function (event) {

},
swfPath: "js",
supplied: "oga",
backgroundColor: "transparent",
cssSelectorAncestor: "#jp_interface"
})

It works great.

BUT

If I do the opposite edit to only support and play Mp3 it will not play:

// Audioplayer begin //////////////////////////////////////////////////
$("#funky-music").jPlayer({
ready: function () {
$(this).jPlayer("setMedia", {
mp3: "sounds/time-to-go.mp3",
});
},
ended: function (event) {

},
swfPath: "js",
supplied: "mp3",
backgroundColor: "transparent",
cssSelectorAncestor: "#jp_interface"
})

.bind($.jPlayer.event.play, function() { // Using a jPlayer event to avoid both jPlayers playing together.
$(this).jPlayer("pauseOthers");
});