我试图在html5游戏中添加声音,奇怪的是在Safari中,我在js控制台中收到此错误:“表达式’Audio'[undefined]的结果不是构造函数”.
我正在使用以下代码加载声音:
var sound = new Audio();
sound.src = "audio/click" + soundext;
sound.onLoad = ResourceLoad();
对于解决此问题的任何帮助,我将不胜感激!
解决方法:
我知道这个问题有点老了,但是这是我搜索问题时发现的问题,因此对于其他搜索者来说,这是我从http://infobrink.com/safari-not-liking-the-html5-audio/中找到的答案
After much frustration I came across a post which indicated that HTML5
audio and video tags will not work in Safari without QuickTime. So
much for HTML5 not requiring any plug-ins. I installed QuickTime and
to my dismay Safari was now giving me the following error when I tried
to start it up.
导致我们的QuickTime没有正确安装!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。