Skip to content

Commit

Permalink
Fixed initial mute state
Browse files Browse the repository at this point in the history
Also addressed early preload issues.
  • Loading branch information
Lanny McNie committed Sep 3, 2012
1 parent ab56047 commit c2e79a3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/soundjs/FlashPlugin.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ this.createjs = this.createjs||{};
*/ */
uniqueId: -1, uniqueId: -1,


owner: null,
capabilities: null, capabilities: null,
flash: null, flash: null,
flashId: null, // To communicate with Flash flashId: null, // To communicate with Flash
Expand Down Expand Up @@ -424,6 +425,7 @@ this.createjs = this.createjs||{};
this.cleanUp(); this.cleanUp();
return false; return false;
} }
if (this.muted) { this.mute(true); }
this.playState = createjs.SoundJS.PLAY_SUCCEEDED; this.playState = createjs.SoundJS.PLAY_SUCCEEDED;
this.owner.registerSoundInstance(this.flashId, this); this.owner.registerSoundInstance(this.flashId, this);
return true; return true;
Expand Down Expand Up @@ -577,6 +579,7 @@ this.createjs = this.createjs||{};
progress: -1, progress: -1,
readyState: 0, readyState: 0,
loading: false, loading: false,
owner: null,


// Calbacks // Calbacks
/** /**
Expand Down Expand Up @@ -622,12 +625,11 @@ this.createjs = this.createjs||{};
*/ */
load: function(src) { load: function(src) {
if (src != null) { this.src = src; } if (src != null) { this.src = src; }
if (this.flash == null) { if (this.flash == null || !this.owner.flashReady) {
loading = true; loading = true;
return false; return false;
} }


//LM: Consider checking the result of the preload call.
this.flashId = this.flash.preload(this.src); this.flashId = this.flash.preload(this.src);
// Associate this preload instance with the FlashID, so callbacks can route here. // Associate this preload instance with the FlashID, so callbacks can route here.
this.owner.registerPreloadInstance(this.flashId, this); this.owner.registerPreloadInstance(this.flashId, this);
Expand Down

0 comments on commit c2e79a3

Please sign in to comment.