Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE continues to load files before it is known that an audio file failed to load #1212

Closed
spayton opened this issue Sep 30, 2014 · 3 comments
Closed

Comments

@spayton
Copy link
Contributor

spayton commented Sep 30, 2014

In IE (10 & 11 tested), a failed audio file load isn't detected until after other files have continued to load. Once the error has been detected the fileError function is called on the wrong _fileIndex.

The problem is demonstrated here, http://jsfiddle.net/stupot/84b6x7s4/

The problem was initially presented in the forum here:

http://www.html5gamedevs.com/topic/9557-failed-audio-file-request-gets-reported-as-failed-image-request-in-ie/

@spayton
Copy link
Contributor Author

spayton commented Sep 30, 2014

Here's what I think is the offending line, it calls fileComplete immediately rather than setting it as a callback, which explains the problem:

file.data.addEventListener('canplaythrough', Phaser.GAMES[this.game.id].load.fileComplete(this._fileIndex), false);

should be something like this?

file.data.addEventListener('canplaythrough', function () { Phaser.GAMES[_this.game.id].load.fileComplete(_this._fileIndex) }, false);

photonstorm added a commit that referenced this issue Oct 5, 2014
Fixes issue #1212 (again), this time properly built and tested
@photonstorm
Copy link
Collaborator

Closing because your fix is now merged with dev.

@speige
Copy link

speige commented Jan 23, 2015

Related to this, The following line probably doesn't remove the event listener correctly, but I don't know of any adverse behavior caused by the event listener not being removed.
file.data.removeEventListener('canplaythrough', Phaser.GAMES[this.game.id].load.fileComplete);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants