Open dprevost-LMI opened 4 weeks ago
Waiting on https://github.com/SimformSolutionsPvtLtd/react-native-audio-waveform/pull/123 merge to fix the player button s issue when clicking stop all
Now waiting on https://github.com/SimformSolutionsPvtLtd/react-native-audio-waveform/pull/136 since some promise rejections are missing to thoroughly test the player after stopping everything!
In a scenario where we want to use the audio player to load several audio messages for different conversations and where navigation between conversations is required only to show one conversation at a time, we need an efficient way to load the audio message but also to cancel nearly everything if we switch to another conversation.
In the above scenario, when navigating away from all those audio players being played or having their waveform extracted, we need to stop them. Otherwise, opening more and more conversations in a short period will bust resources (promises, players, extractors).
This PR provides a new
stopAllWaveFormExtractors
, which, when called, stops all waveform extraction to free resources for the following conversation that will be loaded. Combined withstopAllPlayers
, the newstopPlayersAndExtractors
in theuseAudioPlayer
hook provides a way to stop everything around the audio players to ensure that no more resources are spent on the unmount screen.The new
Stop all players and extractos
option:Other:
CountDownLatch
was removed since it was not used anywhere.tintColor
issue not to work