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.
1 parent f83d288 commit 8f34253Copy full SHA for 8f34253
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