Hi,
Im trying to integrate Jplayer and wicket to allow me to create a MP3
playing component in wicket. But I seem to be running into a problems with
the way I access MP3 files. The HTML and Javascript generated by wicket at
runtime seems to be right but I get a Javascript error "Not allowed to load
local resource". If I simply take the generated code and create a html file
from it the MP3 file plays and I get no JS error.
Your help would be much appreciated.
Java/Wicket
----------------
public class DisplayMP3 extends WebPage
{
public DisplayMP3()
{
}
@Override
public void renderHead(HtmlHeaderContainer container)
{
final ResourceReference jPlayer2 =
new ResourceReference(DisplayMP3.class,"jquery.min.js");
final ResourceReference jPlayer =
new
ResourceReference(DisplayMP3.class,"jquery.jplayer.min.js");
container.getHeaderResponse().renderJavascriptReference(jPlayer2);
container.getHeaderResponse().renderJavascriptReference(jPlayer);
String js =
"$(document).ready(function(){$(\"#jpId\").jPlayer({ ready:
function () { " +
"this.element.jPlayer(\"setFile\",
\"C:/Documents and
Settings/drobson/My
Documents/workspace/OrangeTest/context/WEB-INF/music/Honeytrap.mp3\");
this.play();}})});";
container.getHeaderResponse().renderJavascript(js, null);
}
}
HTML
-------------
<html>
<wicket:head>
</wicket:head>
<body>
<div id="jpId"></div>
</body>
</html>
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Integration-of-Jplayer-and-Wicket-tp2259121p2259121.html
Sent from the Wicket - Dev mailing list archive at Nabble.com.