mirror of
https://github.com/DPS2004/gba.git
synced 2025-04-29 18:59:24 -04:00
Update XAudioServer.js
This commit is contained in:
parent
ece7e865c5
commit
ccc1a8200f
1 changed files with 14 additions and 5 deletions
|
@ -202,13 +202,22 @@ XAudioServer.prototype.initializeWebAudio = function () {
|
|||
}
|
||||
var parentObj = this;
|
||||
XAudioJSWebAudioWatchDogTimer = setInterval(function () {
|
||||
var timeDiff = (new Date()).getTime() - XAudioJSWebAudioWatchDogLast;
|
||||
if (timeDiff > 500) {
|
||||
parentObj.initializeWebAudio();
|
||||
}
|
||||
if(typeof XAudioJSWebAudioContextHandle.state != "undefined" && XAudioJSWebAudioContextHandle.state === 'suspended') {
|
||||
XAudioJSWebAudioWatchDogLast = (new Date()).getTime();
|
||||
try {
|
||||
XAudioJSWebAudioContextHandle.resume();
|
||||
}
|
||||
catch (e) {}
|
||||
}
|
||||
else {
|
||||
var timeDiff = (new Date()).getTime() - XAudioJSWebAudioWatchDogLast;
|
||||
if (timeDiff > 500) {
|
||||
parentObj.initializeWebAudio();
|
||||
}
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
if (this.userEventLatch) {
|
||||
if (this.userEventLatch && typeof XAudioJSWebAudioContextHandle.state != "undefined") {
|
||||
var lazyEnableWA = function () {
|
||||
if(XAudioJSWebAudioContextHandle.state === 'suspended') {
|
||||
XAudioJSWebAudioContextHandle.resume();
|
||||
|
|
Loading…
Add table
Reference in a new issue