Im trying to follow the tutorial at http://www.script-tutorials.com/how-to-play-audio-video-using-jplayer/.
Following is my JS code:
<script type="text/javascript">
var song2 = "http://robtowns.com/music/blind_willie.mp3";
$(document).ready(function() {
$("#jquery_jplayer_1").jPlayer( {
ready: function () {
$(this).jPlayer("setMedia", {
mp3:song2
}).jPlayer("play");
$("#jquery_jplayer_1").jPlayer("pause", 0);
},
supplied: "mp3"
});
});
</script>
i have imported jplayer and jquery script files. But it does not work. related HTML code is also there. Any ideas what i'm doing wrong?
The code you posted seems to work. (link to fiddle)
I can only guess what doesn't work, since your question isn't really precise in that sense.
If you're using Firefox, be warned that mp3 files aren't supported, so you'll need to give jPlayer also an alternative source in ogg format or provide a Flash based player fallback.