HTML5音频与网络音频API - 在Firefox中不工作 [英] HTML5 Audio, with Web Audio API - Not Working in Firefox

查看:146
本文介绍了HTML5音频与网络音频API - 在Firefox中不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我最近公布了这个问题:点击此处

So I recently posted this question: CLICK HERE

和我得出的结论,我只是没有足够的时间,使这项工作为Firefox。这将是很好的,但我有我需要工作在其他项目上。所以我决定在此只是进行简单的功能检查,以便它在Firefox仍然发挥,但不尝试加载可视化,这是造成整个球员抓住和根本无法播放。

And I have come to the conclusion, that I just don't have the time to make this work for Firefox. It would be nice, but I have other projects that I need to work on. So I have decided to just perform a simple functionality check on this, so that it will still play in Firefox, but not attempt to load the visualizer, which is causing the entire player to seize up and not play at all.

但我不知道在所有功能检查?在Web API的工作时,它只是在Web API,以及自定义控件的工作,当它只是自定义控件,那么究竟是什么我会检查,使

But I'm not sure at all with functionality to check for? The Web API works when it's just the Web API, and the Custom Controls work, when it's just the Custom Controls, so what exactly would I check for, so that

if(functionality not supported){
    //Don't load Visualizer at all();
}

我原来jFiddle是在这里: http://jsfiddle.net/murphy1976/yqqf7uL1/1/

推荐答案

好了,你要解决一个bug在这里。所以如果你想真正的功能检测,你需要编写一个试图做你想要什么,看看是否可行与否的功能。因为你处理CORS的东西,并提出请求,这意味着这将是一个异步测试 - 这取决于你的应用程序的设置方式这可能是艰难的。

Well, you're trying to work around a bug here. So if you want real feature detection, you'd need to write a function that tries to do what you want and see if it works or not. Because you're dealing with CORS stuff and making requests, that means it'll be an asynchronous test - which might be tough depending on how your app is set up.

另一种选择,这将是次优的,但也很容易,是刚刚做类似 /firefox/i.test(navigator.userAgent的)

Another option, which would be sub-optimal but also very easy, is to just do something like /firefox/i.test( navigator.userAgent ).

这篇关于HTML5音频与网络音频API - 在Firefox中不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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