GetStream / stream-video-js

GetStream JavaScript Video SDK
https://getstream.io/video/sdk/
Other
57 stars 19 forks source link

fix: prevent double sound detectors set up #1371

Closed myandrienko closed 1 month ago

myandrienko commented 1 month ago

Calling startSpeakingWhileMutedDetection multiple types without awaiting leads to multiple sound detectors being set up. Calling stopSpeakingWhileMutedDetection afterwords cleans up only one of them.

Since startSpeakingWhileMutedDetection is called in a callback to an Rx observable, it's very possible that multiple sound detectors will be set up when the state updates fire rapidly.

This fix prevents that.