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

[Audio Player] Forbid concurrent audio playback #76

Closed LanesGood closed 1 year ago

LanesGood commented 1 year ago

If an audio clip is already playing, that clip should be paused when the user clicks on a new clip. [Nice to have]

oliverroick commented 1 year ago

I don't think we should do that; it's going to add a lot of complexity to the whole application with very little benefit. Currently all the audio players are encapsulated so they don't know when another player is playing, which is good design. If we want to stop an ongoing output when a new output starts, we need a way to know what every audio player is doing at all times: The player for the selected file and all the players in the results table and grids. For that, we need to track the status of every audio player centrally and surrender control of playing audio to the whole application; meaning the state for every audio play needs to managed on the search-page level. This then has further implications for how we render the results: That needs to managed on the page level too.

LanesGood commented 1 year ago

Very much appreciate this feedback and overview of what would be required @oliverroick. I agree that the benefit of this suggested feature is not worth the complexity you've outlined. My thoughts around this issue were more on the nice-to-have track, and potentially would be more appropriate for an audio playback centered application. Indeed, the type of architecture you've described makes more sense when thinking of a music player with a single audio player interface.

I'll close this issue to avoid clutter.