迫使firefox通过jplayer播放mp3

时间:2013-06-03 22:08:14

标签: jquery html firefox mp3 jplayer

如何强制firefox用jplayer播放mp3文件?

这是我的代码:

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link href="js/jPlayer/skin/blue.monday/jplayer.blue.monday.css" rel="stylesheet" type="text/css" />
<script src="js/jquery.min.js"></script>
<script src="js/jPlayer/jquery.jplayer.min.js"></script>
<script>
$(document).ready(function() {

    $("#jquery_jplayer_1").jPlayer({
        ready: function(event) {
            $(this).jPlayer("setMedia", {
                mp3: "http://www.drsamavati.com/test/1370204996.mp3"
            });
        },
        swfPath: "js/jPlayer/",
        supplied: "mp3",
        volume: 1,
        solution: "html,flash",
        errorAlerts: true,
        wmode: "window",
        smoothPlayBar: true,
        keyEnabled: true,
        warningAlerts: true

    });
});
</script>
<body>
<div id="jquery_jplayer_1" class="jp-jplayer"></div>

<div id="jp_container_1" class="jp-audio">
    <div class="jp-type-single">
        <div class="jp-gui jp-interface">
            <ul class="jp-controls">

                <!-- comment out any of the following <li>s to remove these buttons -->

                <li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
                <li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
                <li><a href="javascript:;" class="jp-stop" tabindex="1">stop</a></li>
                <li><a href="javascript:;" class="jp-mute" tabindex="1" title="mute">mute</a></li>
                <li><a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute">unmute</a></li>
                <li><a href="javascript:;" class="jp-volume-max" tabindex="1" title="max volume">max volume</a></li>
            </ul>

            <!-- you can comment out any of the following <div>s too -->

            <div class="jp-progress">
                <div class="jp-seek-bar">
                    <div class="jp-play-bar"></div>
                </div>
            </div>
            <div class="jp-volume-bar">
                <div class="jp-volume-bar-value"></div>
            </div>
            <div class="jp-current-time"></div>
            <div class="jp-duration"></div>                   
        </div>
        <div class="jp-title">
            <ul>
                <li>Cro Magnon Man</li>
            </ul>
        </div>
        <div class="jp-no-solution">
            <span>Update Required</span>
            To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.
        </div>
    </div>
</div>
</body>
</html>

0 个答案:

没有答案