I am trying to integrate a mp3 player in WordPress using the following code:
$(document).ready(function(){
var description = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit';
var path_php = "<?php bloginfo('template_directory'); ?>";
$('body').ttwMusicPlayer(myPlaylist, {
autoPlay:false,
description:description,
jPlayer:{
swfPath: path_php+'/plugin/jquery-jplayer'
}
});
});
In a weird way the player is working just in Opera and IE8. The script is correct integrated because it work if i write the absolute path of the blog for the var php_path.
Can help me with what i am missing? Thanks!
later edit: if you have an idea about a different approach of how to load a wp template path in above jquery code, i am open to it.
here is the browser output for the above code:
$(document).ready(function(){
var description = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit';
var path_php = "http://localhost/mywebsite/wp-content/themes/mythemename";
$('body').ttwMusicPlayer(myPlaylist, {
autoPlay:false,
description:description,
jPlayer:{
swfPath: path_php+'/plugin/jquery-jplayer'
}
});
});