MidiPlayerJS
MidiPlayerJS copied to clipboard
playing event fires after endOfFile
Player.on('playing', (currentTick) => console.log("playing"));
Player.on('endOfFile', () => console.log("endOfFile"));
I consistently get one playing event firing after the endOfFile event. Is this expected behaviour? Thanks!
Same question.
A fix for this would be to change the implementation from:
if (!dryRun) this.triggerPlayerEvent('playing', {
tick: this.tick
});
to:
if (!dryRun && this.isPlaying()) this.triggerPlayerEvent('playing', {
tick: this.tick
});