amazon-chime-sdk-js
amazon-chime-sdk-js copied to clipboard
Catch error when attendees are unable to connect to signalling channel.
What are you trying to do?
Several times we had the problem that an attendee wasn't able to connect to the websocket signalling channel due to for example being on a VPN that doesn't allow the attendee to connect. We want at that moment to be able to communicate to the attendee that the connection cannot be established and therefore redirect the user. However, we do not see a way of catching the error and responding to it as it happens before the audioVideoDidStop
and also before the meetingSession.audioVideo.realtimeSubscribeToFatalError
. We also tried wrapping the audioVideo.start()
in a try-catch but without success.
If anyone knows a way to capture this error that would be awesome 😄
What documentation have you looked at so far?
We searched for a way to catch the error occurring when trying to connect to the meeting, or even before that. As mentioned above, the following options have been tried & looked at but without success:
-
meetingSession.audioVideo.realtimeSubscribeToFatalError()
https://aws.github.io/amazon-chime-sdk-js/classes/defaultaudiovideofacade.html#realtimesubscribetofatalerror - Wrapping the
meetingSession.audioVideo.start()
in a try-catch https://aws.github.io/amazon-chime-sdk-js/classes/defaultaudiovideofacade.html#start - Getting the
MeetingSessionStatus
in theaudioVideoDidStop
observer. https://aws.github.io/amazon-chime-sdk-js/interfaces/audiovideoobserver.html#audiovideodidstop
Screenshot of the console-error
Unfortunately, currently we do not provide a way to catch these errors. I will bring it back to our team and put it to our feature enhancement list.
Hello, I have 2 questions regarding to 'audioVideoDidStop'.
- Can I use it marked as a meeting session ended no matter what MeetingSessionStatusCode I get?

What is the definition of 'No audio connections' here? If in one meeting there is only one attendee having no audio input, no video input, but audio output, does he count for 'no audio connections' and 'audioVideoDidStop' will invoke after 5mins?
Thanks!
@HbZh
- It depends on what you define a meeting end but usually no. AudioVideoDidStop just mean the current meeting session stops for the attendee. They can still rejoin the same meeting unless it was deleted by the application using DeleteMeeting API or the meeting auto-end based on the policies in the comment of the code you pasted.
- No audio connection just means no attendee joins with an audio device.
Hi @ReneS1991, I'm facing the same problem than you, without any solution for now ...
I tried a workaround by stopping the connection after a certain time (3000 ms for instance) :
audioVideoObserver = {
audioVideoDidStartConnecting(reconnecting) {
console.log('RLE audioVideoDidStartConnecting', {reconnecting})
setTimeout(() => {
if (!this.audioVideoStarted) {
audioVideo.stop()
}
}, 3000)
},
audioVideoDidStart() {
console.log('RLE audioVideoDidStart')
this.audioVideoStarted = true
},
audioVideoDidStop(sessionStatus: MeetingSessionStatus) {
console.log('RLE audioVideoDidStop', {
sessionStatus,
statusCode: sessionStatus?.statusCode(),
})
},
}
audioVideo.addObserver(audioVideoObserver)
Unfortunately, amazon-chime-sdk-js
keeps trying to connect to the Chime Meeting, event if I called explicitly audioVideo.stop()
.
@ltrung it takes 2 minutes to get the audioVideoDidStop
event with statusCode = TaskFailed
.
Is there a way to tell amazon-chime-sdk-js
how much time we are ok to wait for audioVideoDidStart
before sending audioVideoDidStop
and stop trying to connect to the Chime Meeting please ?
If not, do you plan on working on this kind of feature ?
Thanks in advance !