logo
On this page

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
    })

Previous

Why does running the source code directly after downloading from GitHub result in an error?

Next

During single stream recording, why does the StreamType set for the whiteboard file not take effect?