jPlayer无法在Firefox中播放mp3 [英] jPlayer not playing mp3 in Firefox

查看:75
本文介绍了jPlayer无法在Firefox中播放mp3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在集成jplayer来播放由使用jQuery的click事件触发的一系列mp3文件.用于实现此目的的代码是:

I'm integrating jplayer to play a selection of mp3 files triggered by an click event using jQuery. The code used to achieve this is:

$('.play-link').click(function() {
    $("#jquery_jplayer_1").jPlayer("destroy");
        srcFile = $(this).attr('href');
        $("#jquery_jplayer_1").jPlayer({
        ready: function (event) {
            $(this).jPlayer("setMedia", {
            mp3:srcFile
            }).jPlayer("play");
        },
        swfPath: "http://www.mydomain.co.uk/swf/Jplayer.swf",
        supplied: "mp3",
        wmode: "window"
    });
return false;
});

通过点击链接的href设置

srcFile.

srcFile is set from the href of the link clicked.

这一切在IE和Chrome的各种版本中都可以正常运行,但在Firefox中却不能.使用Firebug将swf加载到浏览器中,因此swfPath看起来是正确的,但是在初始化播放器时没有任何进一步发生.

This all works fine in the various versions of IE and Chrome but not in Firefox. Using Firebug the swf is being loaded into the browser so the swfPath appears to be correct but nothing further happens when the player is initialised.

有人能阐明为什么仅在Firefox中无法正常工作吗?

Is anybody able to shed any light on why this would not be working in Firefox alone?

谢谢

推荐答案

MP3文件,因此jPlayer在FF浏览器中运行时将无法播放它们.

MP3 files are not supported by Firefox and therefore jPlayer will not play them while running in the FF browser.

您必须具有.ogg音频文件,jPlayer才能在Firefox中工作.请参见下面的浏览器列表及其各自兼容的文件:

You must have .ogg audio files for jPlayer to work in Firefox. See below list of browsers and their respective compatible files:

HTML5 browsers and their supported audio file formats:

Firefox (OSX, Win): WEBMA, OGA
Safari (OSX, Win): MP3, M4A
Mobile Safari iOS4 (iPad, iPhone, iPod): MP3, M4A
Opera (OSX, Win): WEBMA, OGA
Chrome (OSX, Win): WEBMA, OGA, MP3, M4A
IE9 (Win): MP3, M4A (Can install the WebM codec.)

这篇关于jPlayer无法在Firefox中播放mp3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆