Switch a whiteboard
This document describes how to switch the displayed whiteboard.
Prerequisites
Create a whiteboard by referring to Create a super board.
Implementation steps
Listen for remote whiteboard switching
zegoSuperBoard = ZegoSuperBoardManager.getInstance();
// Listen for remote whiteboard switching
zegoSuperBoard.on('remoteSuperBoardSubViewSwitched', function (uniqueID) {
// 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();
// Get superBoardView
if (superBoardView) {
// Switch a whiteboard.
// subViewModel is a model in the whiteboard sharing list ZegoSuperBoardManager.getSuperBoardSubViewModelList()
superBoardView.switchSuperBoardSubView(subViewModel.uniqueID).then(function(){
// Switch whiteboard callback
// The UI can be updated according to data in ZegoSuperBoardManager.getInstance().getSuperBoardView().getCurrentSuperBoardSubView(). For example, the whiteboard name displayed currently can be updated.
});
