From 283049e514244ba153772ff8535cc341c4198cd9 Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum Date: Tue, 22 Aug 2017 11:33:18 -0400 Subject: [PATCH] Safely stop sounds in safari --- src/SoundPlayer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SoundPlayer.js b/src/SoundPlayer.js index 35e9e67..009b3d5 100644 --- a/src/SoundPlayer.js +++ b/src/SoundPlayer.js @@ -48,7 +48,7 @@ class SoundPlayer { * Stop the sound */ stop () { - if (this.bufferSource) { + if (this.bufferSource && this.isPlaying) { this.bufferSource.stop(); } this.isPlaying = false;