如何在jPlayer(Firefox)中使用flash解决方案

时间:2013-05-30 14:20:07

标签: flash firefox jplayer

我正在尝试在我的网站上安装jPlayer,但它不适用于Firefox(22.0)。仅当我单击随机按钮时才会显示播放列表,然后我可以播放歌曲,但进度条始终为空。 当DOM准备就绪时,列表为空(带有jp-playlist类的div)。

以下是代码:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        var jplayer = new jPlayerPlaylist({
                jPlayer: "#jquery_jplayer_1",
                cssSelectorAncestor: "#jp_container_1"                                       
            }, [{
                    title="My title",
                    mp3 : "/music/my_song.mp3"
               },
               {
                   title="My title2",
                   mp3 : "/music/my_song2.mp3"
               }], 
            {
                    swfPath: "http://www.jplayer.org/latest/js/Jplayer.swf",
                    supplied: "mp3",
                    volume: .7,
                    wmode:"window",
                    solution: "html,flash"
            });
    });
</script>
<div id="jp_container_1" class="jp-video jp-video-270p">
    <div class="jp-type-playlist">
            <div id="jquery_jplayer_1" class="jp-jplayer"></div>
            <div class="jp-gui">
            <div class="jp-interface">
                <div class="jp-progress">
                    <div class="jp-seek-bar">
                        <div class="jp-play-bar"></div>
                    </div>
                </div>
                <div class="jp-current-time"></div>
                <div class="jp-duration"></div>
                <div class="jp-controls-holder">
                    <ul class="jp-controls">
                        <li><a href="javascript:;" class="jp-previous" tabindex="1">Pr&eacute;c&eacute;dent</a></li>
                        <li><a href="javascript:;" class="jp-play" tabindex="1">Jouer</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-next" tabindex="1">Suivant</a></li>
                    </ul>
                    <div class="sound-bar">
                        <ul class="jp-controls sound">
                            <li><a href="javascript:;" class="jp-mute" tabindex="1" title="Muet">Mute</a></li>
                            <li><a href="javascript:;" class="jp-unmute" tabindex="1" title="Actif">Unmute</a></li>
                            <li><a href="javascript:;" class="jp-volume-max" tabindex="1" title="Volume max">Volume max</a></li>
                        </ul>
                        <div class="jp-volume-bar">
                            <div class="jp-volume-bar-value"></div>
                        </div>
                    </div>
                    <ul class="jp-toggles">
                        <li><a href="javascript:;" class="jp-shuffle" tabindex="1" title="Al&eacute;atoire">Al&eacute;atoire</a></li>
                        <li><a href="javascript:;" class="jp-shuffle-off" tabindex="1" title="D&eacute;sactiver al&eacute;atoire">Non al&eacute;atoire</a></li>
                        <li><a href="javascript:;" class="jp-repeat" tabindex="1" title="R&eacute;p&eacute;ter">R&eacute;p&eacute;ter</a></li>
                        <li><a href="javascript:;" class="jp-repeat-off" tabindex="1" title="D&eacute;sactiver r&eacute;p&eacute;tition">Ne pas r&eacute;p&eacute;ter</a></li>
                    </ul>
                </div>
                <div class="jp-title">
                    <ul>
                        <li></li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="jp-playlist">
            <ul>
                <!-- The method Playlist.displayPlaylist() uses this unordered list -->
                <li></li>
            </ul>
        </div>
    </div>
</div>
<script type="text/javascript" src="/js/jPlayer/jplayer.min.js"></script>
<script type="text/javascript" src="/js/jPlayer/add-on/playlist.min.js"></script>

感谢您的帮助

1 个答案:

答案 0 :(得分:0)

swfPath: "http://www.jplayer.org/latest/js/Jplayer.swf",更改为«swfPath: "js",

我相信swfPath应该是包含.swf文件的文件夹的路径,而不是文件本身的正常路径。

“必须将Jplayer.swf文件上传到您的服务器。默认位置是相对于当前页面名为”js“的文件夹。要修改Flash文件的位置,请使用swfPath构造函数选项。如何将swfPath设置为相对于服务器根目录的路径。有关详细信息,请参阅jPlayer({swfPath})构造函数选项。“ - http://www.jplayer.org/latest/developer-guide/#jPlayer-server-response