【问题标题】:play button and progress bar of jplayer not working in firefoxjplayer的播放按钮和进度条在firefox中不起作用
【发布时间】:2012-12-12 07:27:56
【问题描述】:

我把 jplayer 放在我的 joomla 网站上播放我的 mp3 文件。问题是使用 Firefox 时播放按钮和 jplayer 的进度条在我的站点中不起作用。我在我的 htaccess 中添加了“添加类型 ogg”。 ogg 文件正在我的站点中播放,但是当我使用 firebug 检查元素时没有显示 ogg 文件。我只能找到一个禁用的代码:

<div class="jp-jplayer" id="jquery_jplayer_1" style="width: 0px; height: 0px;">
    <img id="jp_poster_0" style="width: 0px; height: 0px; display: none;" src=" images/jmplayer/albums/thumb_13520917357864.jpeg">
    <object width="1" height="1" id="jp_flash_0" data="js/Jplayer.swf" type="application/x-shockwave-flash" style="width: 0px; height: 0px;">
    <param name="flashvars" value="jQuery=jQuery&amp;id=jquery_jplayer_1&amp;vol=0.8&amp;muted=false">
    <param name="allowscriptaccess" value="always"><param name="bgcolor" value="#000000">
    <param name="wmode" value="opaque"></object>
</div>

这是我的链接:http://www.keralacarpentry.com/saavnnew

【问题讨论】:

标签: javascript jplayer


【解决方案1】:

实际上jPlayer使用html 5音频标签和firefox不支持mp3 filesaudio标签 W3schools Reference

其他参考资料:

Why doesn't Firefox support mp3 file format in

why is jPlayer not playing my MP3 files in Firefox?

【讨论】:

  • 感谢您的重播。我的 jplayer 正在火狐中播放 ogg 文件。问题是播放按钮和进度条不起作用。
【解决方案2】:

Firefox 不支持 mp3 文件,但要使其使用 jplayer 播放,请确保您已在 firefox 中安装 Flash 并在 javascript 中包含 swf 路径,如下所示

$("#jquery_jplayer").jPlayer({
    ready: function () {
      $(this).jPlayer("setMedia", { mp3: "http://sound26.mp3pk.com/indian/ladiesvsricky/ladiesvsrickybahl01(www.songs.pk).mp3" } );
    },
    //swfPath: "http://cloudfactory-transcription.s3.amazonaws.com/javascripts/",
    swfPath: "http://www.jplayer.org/latest/js/Jplayer.swf",
    supplied: "mp3",
    volume: 1,
    wmode:"window",
    solution: "html,flash",
});

Jplayer 仅使用 Flash 在 Firefox 中播放 mp3 文件。

【讨论】:

  • 感谢您的重播。我的 jplayer 正在火狐中播放,但问题是播放按钮和进度条不起作用。请给我一个建议
【解决方案3】:

对于#jquery_jplayer_1,您绑定了两次:
1。在第 693 行
2。当 $('#playallinner').click 时,你再次绑定。

建议修改:
1。将代码从 693 删除到 703

        /*
        var myPlaylist = new jPlayerPlaylist({
           jPlayer: "#jquery_jplayer_1",
           cssSelectorAncestor: "#jp_container_1"
         }, {
          playlistOptions: {
                  enableRemoveControls: true
          },
        swfPath: "js",
        supplied: "mp3",
        wmode: "window"
        });
         */

然后: 2.从1794更改代码,例如:

//new a jPlayerlist object
var playallList = new jPlayerPlaylist({
        jPlayer: "#jquery_jplayer_1",
        cssSelectorAncestor: "#jp_container_1"
    }, {
        swfPath: "js",
        supplied: "mp3",
        wmode: "window"
});
// add list into the list
playallList.setPlaylist([           
           {
             title:"Aadhai Aaula",
             artist:"Mipa",
             .... // list all songs you want
           },

]);
//play the list when the play button be clicked.
$('#playallinner').click(function(){
     playallList.play();
     var playcount = /*parseInt($("#playtotal").html())+*/ 6;
     $("#playtotal").text(playcount);
});

【讨论】:

  • 感谢您的精彩回复。但我在我的程序中实现了这个,但我找不到任何更改。问题仍然存在于 firefox。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-01-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多