Procházet zdrojové kódy

better audio notification

David Catuhe před 5 roky
rodič
revize
a9fa7439d9
1 změnil soubory, kde provedl 3 přidání a 4 odebrání
  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() {