Hi everyone
Maybe someone can point me en the right direction here.
I've created a component that plays a sound file using an audio element:
var _audioEle = document.createElement('audio');
But, the element keeps playing when the user changes from one page to another. For instance when the user clicks back to the menu.
Is there a way to detect when the user leaves a page and then stop the audio element? For instance with:
_audioEle.pause();
Any help here will be much appreciated
Henrik