logo
On this page

Why is the whiteboard or file content seen on each end out of sync?

2021-09-09
Products / Plugins:Interactive whiteboard / File sharing
Platform / Framework:Web

Problem Description

When there are multiple whiteboards in the current room, after multiple users enter the room, they may see different whiteboard content. For example, after the teacher switches the whiteboard, the student end does not automatically sync the whiteboard switched by the teacher end.

Problem Cause

When a client switches the whiteboard without notifying other clients, or other clients receive the notification but fail to sync the whiteboard switch, the whiteboard content will be out of sync.

Solution

After a client creates, switches, or destroys a whiteboard, it needs to sync to other clients, and other clients perform sync operations.

Taking the Web platform as an example:

The creation and destruction of whiteboards have been synchronized internally by the SDK, which will actively push to all members in the room. Developers only need to register the corresponding listening events (viewAdd and viewRemoved) to obtain the whiteboard instances created by others and the IDs of destroyed whiteboards, and then execute the corresponding business logic.

Note

The creation and destruction of whiteboards on this end will not trigger the listening events on this end.

The whiteboard switching operation is as follows:

  1. Get existing whiteboards. Get the ZegoWhiteboardView that needs to be displayed. You can use the following two methods:

    • Call getViewList to get a list of all created ZegoWhiteboardView in the room, and filter out the target ZegoWhiteboardView.
    • Get the target ZegoWhiteboardView in the viewAdd listener.
  2. Display the target whiteboard. Call attachView to add the target ZegoWhiteboardView to the view for display.

  3. Inform other users in the room of the current displayed whiteboard information. Send the unique identifier ID of the target ZegoWhiteboardView (which can be obtained through the interface getID) to other members in the room. You can use the following three methods:

  4. Other users switch to the corresponding whiteboard. Other members use this ID to find the target ZegoWhiteboardView through steps 1 and 2, and display the view on the top layer of the interface.

For registering listening events, please refer to on.

Previous

Why does Express SDK report error 1002001 when logging into a room?

Next

How to handle issues when integrating Express SDK?

On this page

Back to top