Switch a whiteboard
This document describes how to switch the displayed whiteboard.
Prerequisites
Creat a whiteboard by referring to Create a super board.
Listen for remote whiteboard switching
zegoSuperBoard = ZegoSuperBoardManager.getInstance();
// Listen for remote whiteboard switching.
zegoSuperBoard.on('remoteSuperBoardSubViewSwitched', function () {
// Receive remote switching of the whiteboard. No operation is required.
// The UI can be updated according to data in ZegoSuperBoardManager.getInstance().getSuperBoardView().getCurrentSuperBoardSubView(). For example, the whiteboard name displayed currently can be updated.
});Proactively switch a whiteboard
var superBoardView = ZegoSuperBoardManager.getInstance().getSuperBoardView();
// Obtain superBoardView.
if (superBoardView) {
// Switch a whiteboard.
// subViewModel is a model in the whiteboard sharing list ZegoSuperBoardManager.getInstance().getSuperBoardSubViewModelList().
superBoardView.switchSuperBoardSubView(subViewModel.uniqueID).then(function(){
// Receive the callback of whiteboard switching.
// The UI can be updated according to data in ZegoSuperBoardManager.getInstance().getSuperBoardView().getCurrentSuperBoardSubView(). For example, the whiteboard name displayed currently can be updated.
});
