mirror of
https://github.com/DPS2004/gba.git
synced 2025-01-22 20:40:32 -03:00
update
This commit is contained in:
parent
ccc1a8200f
commit
5e48af37de
1 changed files with 12 additions and 10 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue