Browse Source

better audio notification

David Catuhe 5 năm trước cách đây
mục cha
commit
a9fa7439d9
1 tập tin đã thay đổi với 3 bổ sung4 xóa
  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() {