As shown in the image below, in the current example app, the stop action is called for all the other players when stopping one player or starting another. This does not scale when there are hundreds of them. Also, with around 40 players, we see a noticeable lag when playing one audio after another.
By adding the playerState and the playerKey in this PR, I could review the logic in the example app so that we could only stop the previous player from playing instead of all of them.
Finally, by adding the recorderState, I also managed to stop any player when starting a recording.
As shown in the image below, in the current example app, the stop action is called for all the other players when stopping one player or starting another. This does not scale when there are hundreds of them. Also, with around 40 players, we see a noticeable lag when playing one audio after another.
By adding the
playerState
and theplayerKey
in this PR, I could review the logic in the example app so that we could only stop the previous player from playing instead of all of them.Finally, by adding the
recorderState,
I also managed to stop any player when starting a recording.