I'm implementing a meeting app that uses Amazon's Chime SKD React. Here is the link of the library. I successfully implemented a meeting, and it works well. However, there is a small issue which with which I'm not satisfied.
There are several meeting statuses that Chime provides.
Here is the enum of the meeting status:
enum MeetingStatus {
Loading,
Succeeded,
Failed,
Ended,
JoinedFromAnotherDevice,
Left,
TerminalFailure
}
These statuses are managed by the useMeetingStatus hook from the SDK itself. I think the statuses are pretty much self explanatory.
You enter a meeting, you get the MeetingStatus.Succeeded status. You leave the meeting you get the MeetingStatus.Left status.
And here is the problem:
Once you leave a meeting and try to enter a new one, you get for a moment MeetingStatus.Left status, and then you get the initial meeting status which should be MeetingStatus.Loading.
So my question is, is there a way to reset the meeting status after the user leaves a meeting with the meetingManager.leave() method?
I also noticed after leaving a meeting and hard reloading the app (page), this doesn't happen, which for me means, there is some state that should be reset after leaving a meeting.
There is a
<MeetingProvider>component which wraps the the meeting app. This meeting provider holds all data in theuseMeetingManagerhook. The solution was to re render the<MeetingProvider>which I did by wrapping the router component with it. Once the user leaves the meeting, the app redirects the user to other page and the<MeetingProvider>re renders.Or, there is also a solution to instantiate a new meetingManager object like this:
and then you pass the
meetingManagerto the<MeetingProvider>like this:This is described here