Skip to content

Commit

Permalink
Stop player when going back to base url
Browse files Browse the repository at this point in the history
  • Loading branch information
villermen committed Jun 7, 2016
1 parent a3536bf commit d7d419a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/client/scripts/helpers/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ class Player {
sample.howl.stop();
}

stopAll() {
this.samples.forEach((sample) => sample.howl.stop());
}

progressStep() {
const { playing } = this;

Expand Down
2 changes: 2 additions & 0 deletions src/client/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ function updateFromHistoryState(state) {
$('body').animate({
scrollTop: sampleTop - 100,
});
} else {
Player.instance.stopAll();
}
}

Expand Down

0 comments on commit d7d419a

Please sign in to comment.