diff --git a/static/js/services/playsound.js b/static/js/services/playsound.js index f0fe1eb6..7078d784 100644 --- a/static/js/services/playsound.js +++ b/static/js/services/playsound.js @@ -119,14 +119,12 @@ define(['underscore', 'Howler', 'require'], function(_, Howler, require) { return null; } - var id = this.getId(name); - if (interval) { - if (this.intervals.hasOwnProperty(id)) { - return this.intervals[id]; + if (this.intervals.hasOwnProperty(name)) { + return this.intervals[name]; } - var i = this.intervals[id] = new SoundInterval(this, id, interval); + var i = this.intervals[name] = new SoundInterval(this, name, interval); if (autostart) { i.start(); } @@ -134,6 +132,8 @@ define(['underscore', 'Howler', 'require'], function(_, Howler, require) { } else { + var id = this.getId(name); + if (!this.shouldPlaySound(name) || !this.shouldPlaySound(id)) { return; }