Explorar o código

Fix pausing on UNSTARTED for FileTrack

Thomas Dy %!s(int64=3) %!d(string=hai) anos
pai
achega
ee22981ab1
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  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) {