0

我正在尝试按照http://www.script-tutorials.com/how-to-play-audio-video-using-jplayer/上的教程进行操作。

以下是我的 JS 代码:

<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>

我已经导入了 jplayer 和 jquery 脚本文件。但它不起作用。相关的 HTML 代码也在那里。任何想法我做错了什么?

4

1 回答 1

0

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.

于 2012-10-31T15:34:03.097 回答