This commit is contained in:
jsemu2 2019-04-24 02:19:58 -04:00
parent ccc1a8200f
commit 5e48af37de

View file

@ -202,17 +202,19 @@ XAudioServer.prototype.initializeWebAudio = function () {
}
var parentObj = this;
XAudioJSWebAudioWatchDogTimer = setInterval(function () {
if(typeof XAudioJSWebAudioContextHandle.state != "undefined" && XAudioJSWebAudioContextHandle.state === 'suspended') {
XAudioJSWebAudioWatchDogLast = (new Date()).getTime();
try {
XAudioJSWebAudioContextHandle.resume();
if(typeof XAudioJSWebAudioContextHandle.state != "undefined") {
if (XAudioJSWebAudioContextHandle.state === 'suspended') {
XAudioJSWebAudioWatchDogLast = (new Date()).getTime();
try {
XAudioJSWebAudioContextHandle.resume();
}
catch (e) {}
}
catch (e) {}
}
else {
var timeDiff = (new Date()).getTime() - XAudioJSWebAudioWatchDogLast;
if (timeDiff > 500) {
parentObj.initializeWebAudio();
else {
var timeDiff = (new Date()).getTime() - XAudioJSWebAudioWatchDogLast;
if (timeDiff > 500) {
parentObj.initializeWebAudio();
}
}
}
}, 500);