소스 검색

Merge pull request #5970 from sebavan/master

Fix sound isPlaying when delayed stop
David Catuhe 6 년 전
부모
커밋
17f3a42523
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/Audio/sound.ts

+ 2 - 2
src/Audio/sound.ts

@@ -743,16 +743,16 @@ export class Sound {
                 } else {
                     this._streamingSource.disconnect();
                 }
+                this.isPlaying = false;
             }
             else if (Engine.audioEngine.audioContext && this._soundSource) {
                 var stopTime = time ? Engine.audioEngine.audioContext.currentTime + time : Engine.audioEngine.audioContext.currentTime;
                 this._soundSource.stop(stopTime);
-                this._soundSource.onended = () => { };
+                this._soundSource.onended = () => { this.isPlaying = false; };
                 if (!this.isPaused) {
                     this._startOffset = 0;
                 }
             }
-            this.isPlaying = false;
         }
     }