Skip to content

Commit 1eb01ba

Browse files
committed
fix for stop method if song is not playing
1 parent 8313691 commit 1eb01ba

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

build/library/core.js

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"scripts": {
2424
"test": "echo \"Error: no test specified\" && exit 1"
2525
},
26-
"version": "0.8.3",
26+
"version": "0.8.4",
2727
"dependencies": {
2828
"@types/webaudioapi": "^0.0.27"
2929
},

source/library/core.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,11 @@ export class PlayerCore {
733733
return;
734734
}
735735

736+
if (!sound.isPlaying) {
737+
// TODO: just return or throw an error
738+
return;
739+
}
740+
736741
// reset the is first time sound is being played to true
737742
sound.firstTimePlayed = true;
738743

0 commit comments

Comments
 (0)