pixi-audio
pixi-audio copied to clipboard
Difference between end and stop event.
Please consider the following code:
PIXI.loader.add([{name: 'anchordown', url: anchorDownSound }]).load(function(){
anchorDownSound = PIXI.audioManager.getAudio('anchordown');
anchorDownSound.on('end', function(){
anchorDown = true;
});
});
when I call anchorDownSound.play()
the sound plays and when the sound track finishes playing at the end, I correctly get the 'end' event and I can set my anchorDown flag.
However, when I call anchorDownSound.stop()
before the file finishes playing I get the 'end' event as well. The expected behavior was to only receive a 'stop' event but not an 'end' event.
I only want the anchorDown flag to be set when the file completed playback to the end.
Hi @dinther! good catch! I will check and try to fix it this week, thanks!