Skip to content

Commit f917c94

Browse files
Emitting fileprogress event
1 parent bdf3844 commit f917c94

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/loader/filetypes/HTML5AudioFile.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,16 @@ var HTML5AudioFile = new Class({
5959
audio.oncanplaythrough = null;
6060
audio.onerror = null;
6161

62-
if(++this.filesLoaded === this.filesTotal)
62+
this.filesLoaded++;
63+
64+
this.percentComplete = Math.min((this.filesLoaded / this.filesTotal), 1);
65+
66+
this.loader.emit('fileprogress', this, this.percentComplete);
67+
68+
if(this.filesLoaded === this.filesTotal)
6369
{
6470
this.onLoad();
6571
}
66-
67-
this.percentComplete = Math.min((this.filesLoaded / this.filesTotal), 1);
6872
},
6973

7074
// Called by the Loader, starts the actual file downloading

0 commit comments

Comments
 (0)