目前我正在使用soundmanager2来启动我的网络应用程序中的声音. SoundManager使用Flash,有时会崩溃,导致声音消失. jQuery中是否有可靠的插件可以使用HTML5而不是Flash来提供声音?
我的设置:
soundManager.url = '/misc/soundmanager2/v20111220/'; // SoundManager fails if the SWF is loaded from the CDN
soundManager.debugMode = true;
soundManager.flashVersion = 9;
soundManager.useFlashBlock = false;
soundManager.useHTML5Audio = true;
最佳答案
SoundManager还可以播放纯HTML5声音.
SoundManager 2 gives you a single,powerful API that supports both new and old,using HTML5 audio where supported and optional Flash-based fallback where needed. Ideally when using SoundManager 2,audio “just works.”
Flash仅(可选)用作后备.或者对于所有浏览器都没有(非常好)支持的一些漂亮的东西.像频谱分析仪等
要“强制”SoundManager2使用HTML5音频,您可以添加以下参数:
soundManager.preferFlash = false;
overrides useHTML5audio. if true and flash support present,will try to use flash for MP3/MP4 as needed since HTML5 audio support is still quirky in browsers.