diff src/app/app.component.ts @ 457:906dd152e333

Unload current audio from the audio player if removed.
author Lucas Thompson <dev@lucas.im>
date Thu, 29 Jun 2017 20:24:31 +0100
parents 7bb0bac6f8dc
children 8d561b6df2fa
line wrap: on
line diff
--- a/src/app/app.component.ts	Thu Jun 29 20:11:14 2017 +0100
+++ b/src/app/app.component.ts	Thu Jun 29 20:24:31 2017 +0100
@@ -266,7 +266,11 @@
         return toRemove;
       }, []);
     if (isPendingRootAudioItem(item)) {
-      this.resourceManager.revokeUrlToResource(item.uri);
+      if (this.rootAudioItem.uri === item.uri) {
+        this.audioService.unload();
+      } else {
+        this.resourceManager.revokeUrlToResource(item.uri);
+      }
     }
     this.analyses.remove(...indicesToRemove);
   }