소스 검색

Fix pausing on UNSTARTED for FileTrack

Thomas Dy 3 년 전
부모
커밋
ee22981ab1
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      src/audio.ts

+ 5 - 1
src/audio.ts

@@ -162,7 +162,11 @@ export class FileTrack extends Track {
   }
 
   pause(): void {
-    if (this.state === PlayState.PAUSED || this.state === PlayState.STOPPED)
+    if (
+      this.state === PlayState.UNSTARTED ||
+      this.state === PlayState.PAUSED ||
+      this.state === PlayState.STOPPED
+    )
       return;
     this.resumeTime = this.manager.getTime() - this.playStartTime;
     if (this.source) {