There are two parts to this change:
1. The computation of peaks is moved from `MessageAudio` to the
`GlobalAudioContext` and thus we can limit the concurrency of the
computations (`p-queue`!) and de-duplicate the computations as well
2. While the peaks are computed the component has to display spinning
animation instead of empty waveform and unclickable UI.
It is practically impossible to rewind audio prior to this commit. With
this commit - clicking first two bars will rewind the audio to its very
start instead of updating its current play time to a specific non-zero v
alue.
`isLoading` was initially used to avoid duplicate loads of the audio on
re-renders, but this has to be handled in GlobalAudioContext not in
MessageAudio.
Introduce new UI and behavior for playing audio attachments in
conversations. Previously, playback stopped unexpectedly during window
resizes and scrolling through the messages due to the row height
recomputation in `react-virtualized`.
With this commit we introduce `<GlobalAudioContext/>` instance that
wraps whole conversation and provides an `<audio/>` element that
doesn't get re-rendered (or destroyed) whenever `react-virtualized`
recomputes messages. The audio players (with a freshly designed UI) now
share this global `<audio/>` instance and manage access to it using
`audioPlayer.owner` state from the redux.
New UI computes on the fly, caches, and displays waveforms for each
audio attachment. Storybook had to be slightly modified to accomodate
testing of Android bubbles by introducing the new knob for
`authorColor`.