You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add two listeners for the event (for example 'end') and instance id (for example 1031).
Call off to remove all listeners for the id like this howl.off('end', undefined, 1031).
Only first one will be cleared.
Reproducible Example
No response
Reproduction Steps
const sound = new Howl({ src: ['sound.mp3'] }); const id = sound.play() sound.on('end', ()=>{console.log(1)}, id); sound.on('end', ()=>{console.log(2)}, id); /*intending to clear all listeners for the event*/ sound.off('end', undefined, id);
Possible Solution
remove break in the for loop
Context
No response
Howler.js Version
2.2.4
Affected Browser(s)/Versiuon(s)
No response
The text was updated successfully, but these errors were encountered:
The Problem
Only first one will be cleared.
Reproducible Example
No response
Reproduction Steps
const sound = new Howl({ src: ['sound.mp3'] }); const id = sound.play() sound.on('end', ()=>{console.log(1)}, id); sound.on('end', ()=>{console.log(2)}, id); /*intending to clear all listeners for the event*/ sound.off('end', undefined, id);
Possible Solution
remove break in the for loop
Context
No response
Howler.js Version
2.2.4
Affected Browser(s)/Versiuon(s)
No response
The text was updated successfully, but these errors were encountered: