First of all, I’m not using WP JWPlayer Plugin. (And i don’t want it. And thats the another story)
Well in the Template file:
wp_register_script('myJW', get_bloginfo('template_url') . '/jwplayer.js');
wp_enqueue_script('myJW');
?>
<div id='myJWPlayer'></div>
<script>
jQuery(document).ready(function(){
jwplayer("myJWPlayer").setup({
playlist: "http://www.example.com/playlist.xml",
listbar: {
position: 'right',
size: 250
},
width: 700,
height: 400
});
});
</script>
It is not working, since even the jwplayer("myJWPlayer")
call is not being triggered.
Note: This codes are perfectly working in pure HTML sites.
Any idea please?
You need to properly enqueue your script. You should hook your script to the
EDIT
http://www.example.com/playlist.xml is not valid playlist url. Also you are missing
"
at the end of the url.Please refer to http://www.longtailvideo.com/support/jw-player/28850/using-the-javascript-api for jwplayer usage.
You also need to call
Try this,
Also see browser error log if you receive any error. You can use firebug for firefox, or if you are using chrome just press f12 that will open devlopement console, go to console and reload page. May be you catch some usefull info there.
Also note that it would be wise to register and enqueue script from functions file.