aws / amazon-chime-sdk-js

A JavaScript client library for integrating multi-party communications powered by the Amazon Chime service.
Apache License 2.0
701 stars 473 forks source link

connectionDidBecomeGood isn't triggered immediately after the network is stable #2769

Closed longhaieva2 closed 10 months ago

longhaieva2 commented 11 months ago

I use connectionDidBecomeGood and connectionDidSuggestStopVideo | connectionDidBecomePoor to handle notifying users when the network has problems and when it is restored The problem I encounter is that the waiting time for the above methods to be called is very long (up to 40 seconds with connectionDidBecomeGood). Please give me suggestions for handling this case

const audioVideoObserver: AudioVideoObserver = new class implements AudioVideoObserver {
  connectionDidBecomeGood?(): void {
       console.log('good')
      }

      connectionDidSuggestStopVideo?(): void {
        console.log('bad')
      }
}
...

meetingManager.audioVideo.addObserver(audioVideoObserver)