From 48ad8bb0421383c31a589332dc817addb0d8cd5b Mon Sep 17 00:00:00 2001 From: Lanny McNie Date: Thu, 8 Jun 2017 11:42:14 -0600 Subject: [PATCH] Possible fix to #269 with comments --- src/soundjs/AbstractPlugin.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/soundjs/AbstractPlugin.js b/src/soundjs/AbstractPlugin.js index 7c71df69..f77d3de6 100644 --- a/src/soundjs/AbstractPlugin.js +++ b/src/soundjs/AbstractPlugin.js @@ -288,10 +288,14 @@ this.createjs = this.createjs || {}; this._audioSources[src] = event.result; for (var i = 0, l = this._soundInstances[src].length; i < l; i++) { var item = this._soundInstances[src][i]; - item.setPlaybackResource(this._audioSources[src]); - // ToDo consider adding play call here if playstate == playfailed - this._soundInstances[src] = null; + item.playbackResource = this._audioSources[src]; + // TODO consider adding play call here if playstate == playfailed } + //LM: This line was in the above if() statement, and caused issues when there was more than one instance + // I was unable to reproduce the scenario, so the line was moved out of the if statement. + // It is possible the solution is instead to delete/splice the instance from the soundInstances[src] list instead. + // https://github.com/CreateJS/SoundJS/issues/269 + this._soundInstances[src] = null; }; /**