After clicking to leave the classroom in the room, the page does not redirect. How to handle this?
2021-09-09
Products / Plugins:Roomkit
Platform / Framework:Web
If you encounter a situation where after clicking to leave the classroom in the room, you still stay on the current page, and after waiting a while, the message "Network connection failed, please check the network and try again" appears, please handle it in the following way:
Because the SDK does not handle page redirection internally, the SDK throws the corresponding events through callbacks, so users need to listen to the leaveRoom event and then handle page redirection, for example:
// Initialize SDK
const zg = new ZegoRoomKit();
// Listen to the leave room event
zg.on('leaveRoom', () => {
console.log('------leaveRoom-------')
// Handle page redirection
})