HTML5 如何为JavaScript游戏替换Internet Explorer的WebAudio API
HTML5 How to replace WebAudio API for Internet Explorer for javascript games?
我是html音频新手。 我找到了一些关于小JavaScript游戏的好例子。 想要我尝试在Internet Explorer中加载游戏,我得到:"此浏览器不支持Web api音频"。
我找到了这个网站:http://caniuse.com/#feat=audio-api,看起来IE浏览器不支持它。
我还发现SoundManager 2似乎适用于所有浏览器。
我的问题,有没有办法检测浏览器是否支持 WebApiAudio 并在不支持时提供回退?
我希望能够在所有不同的浏览器上提供相同的功能,但目前我不知道该怎么做。
一个不错的功能是能够同时播放多种声音,并具有可调节的音量声音(如爆炸)。
我想创建一个可以在PC,Mac,Android和Ipad上运行的helloworld。 可能吗?
非常感谢我的多个问题。
我检查了这个演示:http://www.cocos2d-x.org/wiki/MoonWarriors_-_Cocos2d-JS_Showcase 声音在 Firefox 中工作正常,但在 Internet Explorer 中只有音乐,没有音效
我的问题,有没有办法检测浏览器是否支持 WebApiAudio 并提供回退(如果不支持)?
"use strict"
function audioContextCheck() {
if (typeof AudioContext !== "undefined") {
return new AudioContext();
} else if (typeof webkitAudioContext !== "undefined") {
return new webkitAudioContext();
} else if (typeof mozAudioContext !== "undefined") {
return new mozAudioContext();
} else {
// Do stuff with soundmanager or something else if Web Audio API is not supported
}
}
var audioContext = audioContextCheck();
相关文章:
- 视频HTML没有'无法在Internet Explorer 11上工作
- Internet Explorer缺少占位符支持,特别是密码字段
- Internet Explorer中的文本换行错误
- 为什么我在Internet Explorer上看不到html元素
- internet explorer 8兼容模式下的Youtube api错误
- 当浏览器控制台未打开时,为什么要求会导致Internet Explorer 9超时
- Internet Explorer 8. Events
- jQuery表单验证适用于Mozilla和Internet Explorer,但不适用于Chrome或Safari
- element.dataset in Internet Explorer
- Facebook FB.init”;访问被拒绝”;在Internet Explorer 11中
- JavaScript不适用于internet explorer和Firefox,但适用于谷歌
- 在Internet Explorer中,向所选内容添加选项不起作用
- 在Internet Explorer中从二进制文件打开PDF
- elementproblem internet explorer
- 我可以使用哪些方法在Internet Explorer中禁用Alt+*X*
- 如何在Internet Explorer中使用javascript设置cookie
- 只有当alert()在带有AJAX的internet explorer中使用时,Javascript才会更新UI
- sharepoint站点的internet explorer中出现Javascript错误
- Internet Explorer重新加载IFrame
- Internet Explorer Internet Failure HTTP Status Codes