pixi-audio icon indicating copy to clipboard operation
pixi-audio copied to clipboard

Difference between end and stop event.

Open dinther opened this issue 8 years ago • 1 comments

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.

dinther avatar Jun 29 '16 03:06 dinther

Hi @dinther! good catch! I will check and try to fix it this week, thanks!

Nazariglez avatar Jul 03 '16 16:07 Nazariglez