We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c3f7000 + 8f34253 commit e94ab0cCopy full SHA for e94ab0c
cocos2d/audio/CCAudio.js
@@ -352,6 +352,15 @@ cc.Audio.WebAudio.prototype = {
352
if (SWA) {
353
var context = new (window.AudioContext || window.webkitAudioContext || window.mozAudioContext)();
354
cc.Audio._context = context;
355
+ // check context integrity
356
+ if (
357
+ !context["createBufferSource"] ||
358
+ !context["createGain"] ||
359
+ !context["destination"] ||
360
+ !context["decodeAudioData"]
361
+ ) {
362
+ throw 'context is incomplete';
363
+ }
364
if (polyfill.DELAY_CREATE_CTX)
365
setTimeout(function () {
366
context = new (window.AudioContext || window.webkitAudioContext || window.mozAudioContext)();
0 commit comments