Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion dev/src/DOMSound.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,12 @@ enchant.DOMSound.load = function(src, type, callback, onerror) {
enchant.EventTarget.call(sound);
sound.addEventListener('load', callback);
sound.addEventListener('error', onerror);
var audio = new Audio();
var audio;
try {
audio = new Audio();
} catch (err) { // On some version of IE9, will throw an exception when new Audio();
audio = {};
}
if (!enchant.ENV.SOUND_ENABLED_ON_MOBILE_SAFARI &&
enchant.ENV.VENDOR_PREFIX === 'webkit' && enchant.ENV.TOUCH_ENABLED) {
window.setTimeout(function() {
Expand Down