gpt4 book ai didi

jquery - HTML5 声音插件?

转载 作者:太空狗 更新时间:2023-10-29 15:36:12 25 4
gpt4 key购买 nike

目前我正在使用 为我的网络应用程序中的声音供电。 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.

来自official docs .

关于jquery - HTML5 声音插件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8992053/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com