瀏覽代碼

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) {