i have tried to implement a jwplayer as
<script src="js/jwplayer.js" type="text/javascript"></script><script type="text/javascript">
<script type="text/javascript">
$(document).ready(function(){
var divid= document.getElementById("mediaplayerid").getAttribute("id");
alert(divid);
jwplayer(divid).setup({
flashplayer: '<%= ResolveUrl("Jwplayer/player.swf")%>',
provider: "video",
file: '<%= ResolveUrl("Videos/2.mp4") %>' ,
autostart: true,
width: '600',
height:'370',
});
});
</script>
where i have taken a div tag in a table as
<div id="mediaplayerid"></div>
</td>
the jwplayer fails to run. i have debug the script.It reaches to a point Jwplayer.setup after it that comes out with no output. what possibly be an error or any code error. thanks for any assistance.
The problem is either that you haven’t referenced the jQuery or the jwplayer in a correct way, or that the path to the video file/flashplayer is wrong. If you can debug your rendered code in Firebug, or something similar, you could check that all paths are valid.
I’ve copied your code and it seems to be working fine: DEMO
You could also try changing the
ResolveUrlto this, specifying the location of the video from the root of your project (or whatever the path is):EDIT
I assume you have your jQuery reference in your code, even though you didn’t paste it?