Skip to content

Commit 6418d95

Browse files
committed
Merge branch 'develop' of https://github.com/cocos2d/cocos2d-html5 into Iss2698_namespace
2 parents 9371662 + 528043f commit 6418d95

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

cocos2d/audio/CCAudio.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -516,10 +516,16 @@ cc.Audio = cc.Class.extend({
516516
return cb(null, loader.cache[url]);
517517

518518
if(SWA){
519-
var volume = context["createGain"]();
520-
volume["gain"].value = 1;
521-
volume["connect"](context["destination"]);
522-
audio = new cc.Audio(context, volume, realUrl);
519+
try{
520+
var volume = context["createGain"]();
521+
volume["gain"].value = 1;
522+
volume["connect"](context["destination"]);
523+
audio = new cc.Audio(context, volume, realUrl);
524+
}catch(err){
525+
SWA = false;
526+
cc.log("browser don't support webAudio");
527+
audio = new cc.Audio(null, null, realUrl);
528+
}
523529
}else{
524530
audio = new cc.Audio(null, null, realUrl);
525531
}

0 commit comments

Comments
 (0)