developmentseed / bioacoustics-frontend

Frontend code for the Google Bioacoustics project that's used by A2O Search
https://search.acousticobservatory.org/
MIT License
1 stars 0 forks source link

fix: Remove audio-player elements after component unmount #134

Closed oliverroick closed 1 year ago

oliverroick commented 1 year ago

Chrome has a limit of ~100 audio elements that can be mounted at a given time. When paging through the results, this means at some point, no new audio elements can be added to the DOM and so the sounds cannot be played.

Added changes to clean up the audio elements and event handlers when the useAudioPlayer hook is unmounted.