I have a jquery jplayer whose html version works fine. When I try to load the flash version as the default one, it stops working.
When I load the page Chrome console shows the error "PPB_Graphics2D.PaintImageData: Rectangle is outside bounds" twice. Firefox doesn't show any JS error.
Here is the jQuery code.
$("#jquery_jplayer_1").jPlayer({
solution:"flash, html",
play: function() { // To avoid both jPlayers playing together.
$(this).jPlayer("pauseOthers");
},
ready: function () {
$(this).jPlayer("setMedia", {
mp3: "http://test.com/music.mp3"
});
},
swfPath: "player/jplayer",
supplied: "mp3",
cssSelectorAncestor: "#jp-audio-container1"
});
If I reverse the solution to solution: "html, flash", the player works fine. This is the flash player generated by the script:
<embed name="jp_flash_0" id="jp_flash_0" src="player/jplayer/Jplayer.swf" width="0" height="0" bgcolor="#000000" quality="high" flashvars="id=jquery_jplayer_1&vol=0.8&muted=false" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" style="width: 0px; height: 0px; ">
Verified that the mp3 url is working fine. I have also verified(using Chrome Network) that the JPlayer.swf file path is correct and is accessible from the above code.
What could be the reason?
Looks like the error "PPB_Graphics2D.PaintImageData: Rectangle is outside bounds" normally happens because of the PepperFlash plugin of Chrome. Some solutions suggest disabling it. That did not work for me.
After a lot of searching around, I solved it by downloading a fresh jquery.jplayer.min.js. Not sure what was wrong with the other one.
[EDIT] It happened to me again during the development. Noting down the result, for the benefit of anyone else having same issue. I used the debug version of Flash plugin for Chrome to troubleshoot this. The error was because JPlayer was not found on the relative URL specified in the "swf" attribute. After spending considerable time with jPlayer, looks like the two things to check in the event of an swf error are - the swf path and the version of JPlayer.swf.