瀏覽代碼

better audio notification

David Catuhe 5 年之前
父節點
當前提交
a9fa7439d9
共有 1 個文件被更改,包括 3 次插入4 次删除
  1. 3 4
      src/Audio/audioEngine.ts

+ 3 - 4
src/Audio/audioEngine.ts

@@ -270,14 +270,13 @@ export class AudioEngine implements IAudioEngine {
                 if (this._muteButton) {
                     this._hideMuteButton();
                 }
+                // Notify users that the audio stack is unlocked/unmuted
+                this.unlocked = true;
+                this.onAudioUnlockedObservable.notifyObservers(this);
             }).catch(() => {
                 this._tryToRun = false;
                 this.unlocked = false;
             });
-
-        // Notify users that the audio stack is unlocked/unmuted
-        this.unlocked = true;
-        this.onAudioUnlockedObservable.notifyObservers(this);
     }
 
     private _triggerSuspendedState() {