我把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&id=jquery_jplayer_1&vol=0.8&muted=false">
<param name="allowscriptaccess" value="always"><param name="bgcolor" value="#000000">
<param name="wmode" value="opaque"></object>
</div>
答案 0 :(得分:0)
实际上jPlayer使用html 5
音频代码而firefox不支持mp3 files
代码上的audio
W3schools Reference
其他参考文献:
答案 1 :(得分:0)
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文件。
答案 2 :(得分:0)
对于#jquery_jplayer_1,您绑定两次:
1。在第693行
2。当$('#playallinner')。点击,你再次绑定。
建议修改:
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);
});