Class
| ZegoLoadOption | ZegoSuperBoardManager |
| ZegoSuperBoardSubView | ZegoSuperBoardSubViewImpl |
| ZegoSuperBoardView |
ZegoLoadOption
Preview File Loading Configuration Options
Details
Set the trigger timing of the callback method for loading dynamic files. Under normal circumstances, the callback is triggered immediately after obtaining the loading file information from the file server.
- Use cases: Get the readiness status of loading dynamic PPT files.
Properties
PPTReady
PPTReady: boolean Get the readiness status of loading dynamic PPT files.
ZegoSuperBoardManager
Details
Interface class, SDK initialization, global function Settings in the room, create files or pure whiteboard, etc.
- Use cases: It is used to initialize the SDK, set some whiteboard tools, zoom synchronization, and brush effects, obtain boardView, and create pure whiteboard and files when the boardView mode is enabled.
- Platform differences: There is no
Properties
enableCustomCursor
~ enableCustomCursor: boolean Detailed description: Set whether to enable custom cursor, set to true to display the cursor. The default is true
Business scenario: the cursor function is displayed during the graffiti process.
Timing of calling: After initializing the SDK.
Supported version: v2.2.0
enableRemoteCursorVisible
~ enableRemoteCursorVisible: boolean Detailed description: Set whether to display the remote cursor or not, set to true to display the remote cursor. The default is true.
Business scenario: display the remote cursor function during the graffiti process.
Timing of calling: After initializing the SDK.
Supported version: v2.2.0
superBoardMaxScaleFactor
~ superBoardMaxScaleFactor: ~ Method description: Set the maximum zoom factor of Super Whiteboard (file and whiteboard), which is 3x by default. The range that can be set is [1,10] Call timing: After initialization, before creating the file/whiteboard, and after unInit expires.
Methods
setSuperBoardMaxScaleFactor
setSuperBoardMaxScaleFactor(scaleFactor: Float): voidParameters
| Name | Type | Description |
|---|---|---|
| scaleFactor | Float | Description maximum zoom factor of Super Whiteboard (file and whiteboard) |
Details
Set the maximum zoom factor of Super Whiteboard (file and whiteboard), which is 3x by default. The range that can be set is [1,10]
- When to call /Trigger: After initialization, before creating the file/whiteboard, and after unInit expires.
- Available since: 2.3.7
renewToken
renewToken(token?: string): voidParameters
| Name | Type | Description |
|---|---|---|
| token | string | A token to be updated. |
- Default value: None
Call time: after initializing the SDK, with the help of the upcoming expiration callback [tokenwillexpire] interface of zego SDK, receive the upcoming expiration callback of the token, and actively update the file service token of the super whiteboard.
Scope of influence: the expiration time contained in the token will trigger the [tokenwillexpire] callback 30s before expiration
Related callback: [tokenwillexpire]
Related interfaces: None
- Platform differences: None
clearLog
clearLog(): Promise<{ code: number }>Upload and clear the local cache log
- Available since: 2.4.0
Operation results
createPreviewFileView
createPreviewFileView(fileID: string, parentDomID: string): Promise<ZegoSuperPreviewView>Parameters
| Name | Type | Description |
|---|---|---|
| fileID | string | The file ID that you want to preview. |
| parentDomID | string | The ID of the mounted element. |
Details
After the user passes in the file ID and parent ID, the user can call this function to create a view for previewing the specified file. This view can be used to display the file content, and return the view object.
- Use cases: After the ZegSuperBoard SDK is initialized, the user can create a preview view in the designated area for viewing the file content without entering the room.
- When to call /Trigger: After the ZegSuperBoard SDK is initialized.
- Available since: v2.19.0
Return
Return a ZegoSuperPreviewView object.
destroyAllSuperBoardSubView
destroyAllSuperBoardSubView(): Promise<boolean>Destroy all SuperBoardSubView views
- Use cases: Called when all whiteboard views need to be destroyed at once
- Default value: none
- When to call: Called after initializing the SDK and logging into the room
- Caution: Asynchronous call, returns Promise<boolean>
- Related callbacks: remoteSuperBoardSubViewRemoved。
- Available since: Version 2.20.0 and above
- Restrictions: Call once on demand
Whether all views are destroyed successfully
enableCustomCursor
enableCustomCursor(enable: boolean): voidParameters
| Name | Type | Description |
|---|---|---|
| enable | boolean | Whether to open |
Details
Supported version: 2.2.0 and above.
Detailed description: Set whether to use a custom cursor for whiteboard graffiti, set it to true to set the cursor to a custom picture.
Required or not: Yes.
Call timing: After the SDK is initialized.
enableRemoteCursorVisible
enableRemoteCursorVisible(enable: boolean): voidParameters
| Name | Type | Description |
|---|---|---|
| enable | boolean | Whether to open |
Details
Supported version: 2.2.0 and above.
Required or not: Yes.
Call timing: After the SDK is initialized.
getCurrentPreview
getCurrentPreview(): ZegoSuperPreviewViewGet the view object of the currently previewed file.
- Use cases: It is used to obtain the file content that is being previewed on the current screen.
- When to call /Trigger: After calling the createPreviewFileView method.
- Available since: 2.19.0
The current preview view.
getInstance
getInstance(): ZegoSuperBoardManager- When to call /Trigger: After integrating ZegoSuperBoard SDK, before initializing ZegoSuperBoard SDK.
- Available since: v2.0.0
Detailed description: Get the ZegoSuperBoardManager instance object to call the interface method in ZegoSuperBoardManager.
ZegoSuperBoardManager instance object
getPreviewList
getPreviewList(): ZegoSuperPreviewView[]When you want to obtain all the preview files, you can call this function to obtain an array containing all the created ZegoSuperPreviewView.
- Use cases: When the preview file list is required.
- When to call /Trigger: After calling the [createPreviewFileView] function.
- Available since: 2.19.0
An array containing all ZegoSuperPreviewView.
getWhiteboardBackgroundColor
getWhiteboardBackgroundColor(): stringcall getWhiteboardBackgroundColor to get the whiteboard background color.
- When to call: after initializing ZegoSuperBoard SDK.
- Available since: 2.0.0 and above.
Whiteboard background color, hexadecimal or RGBA
setCustomCursorAttribute
setCustomCursorAttribute(type: ZegoSuperBoardTool, attr: ZegoCursorAttribute): Promise<any>Parameters
| Name | Type | Description |
|---|---|---|
| type | ZegoSuperBoardTool | Set the tool type, currently only supports setting the brush style |
| attr | ZegoCursorAttribute | Custom cursor related attributes |
Details
Supported version: 2.2.0 and above.
Detailed description: Set the pointer icon of the local custom cursor and the hot spot of the pointer (that is, the actual click position of the custom icon)
Required or not: Yes.
To set the hot spot of the pointer, two unitless non-negative numbers less than 32 are recommended.
Calling time: after opening the local custom cursor.
setLogConfig
setLogConfig(config: ZegoLogConfig): booleanParameters
| Name | Type | Description |
|---|---|---|
| config | ZegoLogConfig | Log configuration options |
Details
Configure the client print log level. Logs are an important means of locating problems.
- Use cases: In most scenarios, customers do not need to call this interface, but use the default configuration.
- Default value: local log is error.
- When to call: After initialization, before any other interface.
Usage restrictions: None, but it is recommended to call it only once in the whole life cycle.
Do not call this interface to change the default configuration unless there is a clear special requirement.
- Available since: 2.1.6 and above
Return
Whether the call is successful; failure: input parameter format is incorrect
switchPreview
switchPreview(preview: ZegoSuperPreviewView): voidParameters
| Name | Type | Description |
|---|---|---|
| preview | ZegoSuperPreviewView | The preview that one wants to switch to. |
Details
Switch to the specified preview file view.
-
Use cases: When the user wants to preview another file.
-
When to call /Trigger: After initializing the SuperBoard SDK.
- Available since: 2.19.0
uploadFile
uploadFile(file: File, renderType: ZegoSuperBoardRenderType, listener: ZegoSuperBoardUploadCallback, uploadOptions?: uploadOptions): Promise<string>Parameters
| Name | Type | Description |
|---|---|---|
| file | File | The file object to be uploaded supports ppt, pdf, xls, jpg, jpeg, png, bmp, txt and other types of files. For details, please refer to File specifications. |
| renderType | ZegoSuperBoardRenderType | After the upload file transcoding rendering mode type, suggest set to VectorAndIMG, see ZegoSuperBoardRenderType. |
| listener | ZegoSuperBoardUploadCallback | The upload progress and result callback. In the process of uploading files, you will receive multiple callbacks in [listener]. For details, please refer to the introduction of ZegoSuperBoardUploadModel |
| uploadOptions | uploadOptions | Upload file configuration items |
Details
During the upload process, the SDK will format the file according to the passed [renderType]. After the format conversion, the rendering mode of the file depends on the passed [renderType]. The progress information of the upload can be obtained in the result callback
- Use cases: Upload files to the ZegoDocs service.
- When to call /Trigger: After ZegSuperBoard SDK is initialized.
Return
Return the ID of the transcoded file
cancelUploadFile
cancelUploadFile(fileHash: string): Promise<boolean>Parameters
| Name | Type | Description |
|---|---|---|
| fileHash | string | Upload fileHash returned when uploadFile is called. |
Details
To cancel the file upload operation, the fileHash of the corresponding upload task must be passed.
- Use cases: File uploading to the ZegoDocs service is interrupted during the process.
When to call
when the uploadFile interface is in the process of uploading a file.Return
Operation result
cacheFile
cacheFile(fileID: string, listener?: ZegoSuperBoardCacheFileCallBack): Promise<ZegoSuperBoardDynamicCacheModel | ZegoSuperBoardStaticCacheModel>Parameters
| Name | Type | Description |
|---|---|---|
| fileID | string | The file ID of the resource that needs to be requested in advance |
| listener? | ZegoSuperBoardCacheFileCallBack | Cache file progress and result callback. The cache progress callback is triggered only when the static type file is loaded. Loading dynamic files does not trigger a cache progress callback. |
Details
The resources of the corresponding file can be requested in advance.
- Use cases: It can optimize the speed of opening files in the same browser and domain name.
- When to call: Used before loading the file.
the API in version 2.0.0 and above is only valid for dynamic files, and version 2.6.0 and above is valid for full file types
Usage restrictions:
- The implementation of this interface depends on the cache strategy of the browser, so the cache only takes effect under the same browser and the same domain name. If the first two are changed, they need to be cached again.
- Limited by the browser cache policy, the cache may be invalid in stealth mode and the domain name is not secure.
- When the user forces to refresh the page, the old cache may be cleared, or when the browser cache is disabled, the cache will not take effect.
- Available since: v2.0.0
Return
Advance request file resource situation
cancelCacheFile
cancelCacheFile(seq: number): booleanParameters
| Name | Type | Description |
|---|---|---|
| seq | number | The sequence number of caching operation. |
Details
You can cancel the operation of caching the file, and you need to pass in the SEQ of the corresponding cache file operation.
- Use cases: The cancelCacheFile method can be called to cancel the operation that needs to be interrupted during the execution of the cache file.
- When to call: it needs to be called after cachefile.
- Related APIs: cacheFile.
this API is only valid when the preload file type is a static file
- Available since: v2.6.0
Return
Operation results
uploadH5File
uploadH5File(filePath: string, config: ZegoUploadCustomH5Config, listener: ZegoSuperBoardUploadH5FileCallback): Promise<string>Parameters
| Name | Type | Description |
|---|---|---|
| filePath | string | File object to be uploaded |
| config | ZegoUploadCustomH5Config | Configuration of H5 courseware customization |
| listener | ZegoSuperBoardUploadH5FileCallback | The upload progress callback. In the process of uploading files, you will receive multiple callbacks in [listener]. For details, please refer to the introduction of uploadH5FileCallBack. |
Details
During the upload process, SDK will convert the format of the file according to the incoming [config]. After the format conversion, the width and height of the page number of the file and whether the thumbnail is included depend on the incoming [config]. The progress information of the upload can be obtained in the result callback.
- Use cases: Upload custom H5 courseware.
- When to call: You need to call it after the initialization is successful.
- Available since: v2.0.0
Return
Return the uploaded file ID
init
init(zegoWebRTC: any, config: ZegoSuperBoardInitConfig): Promise<boolean>Parameters
| Name | Type | Description |
|---|---|---|
| zegoWebRTC | any | Instance object of Express-Video SDK |
| config | ZegoSuperBoardInitConfig | Configuration information required for SDK initialization |
Details
Method to initialize the ZegoSuperBoard SDK.
- Use cases: Initialize the ZegoSuperBoard SDK.
- When to call: Before calling the ZegoExpressEngine SDK's loginRoom interface
Please initialize the ZegoSuperBoard SDK successfully before calling the loginRoom method
- Available since: v2.0.0
Return
Initialization result callback
setCustomizedConfig
setCustomizedConfig(key: ZegoSuperboardCustomConfigKey, value: string): booleanParameters
| Name | Type | Description |
|---|---|---|
| key | ZegoSuperboardCustomConfigKey | Configuration item |
| value | string | Configuration item value |
- When to call: Called after initializing the Superboard SDK
- Available since: v2.0.0
Return
Whether the setting is successful
enableSuperBoardView
enableSuperBoardView(enable: boolean): voidParameters
| Name | Type | Description |
|---|---|---|
| enable | boolean | true: SuperBoardView is used. false: SuperBoardView is not used,The default is true |
Details
Set whether to use SuperBoardView.
When to call : Before initializing the SDK.
Open by default
- Available since: v2.0.0
createWhiteboardView
createWhiteboardView(config: ZegoCreateWhiteboardConfig): Promise<ZegoSuperBoardSubViewModel>Parameters
| Name | Type | Description |
|---|---|---|
| config | ZegoCreateWhiteboardConfig | Configuration parameters related to pure whiteboard.Among them, perPageWidth and perPageHeight must be positive integers, otherwise the creation will fail |
- When to call: After initializing the ZegoSuperboard SDK, calling [loginRoom] to log in to the room, when you need to create a pure whiteboard.
Return
Return the model of the whiteboard
createFileView
createFileView(config: ZegoCreateFileConfig): Promise<ZegoSuperBoardSubViewModel>Parameters
| Name | Type | Description |
|---|---|---|
| config | ZegoCreateFileConfig | The configuration parameters required to create the file |
Details
After the creation is successful, the corresponding SubView will be saved internally and its subViewModel data will be returned.
When to Call: Initialize the ZegoSuperboard SDK and call [loginRoom] to login to the room when the file needs to be created.
Return
Returns the ZegoSuperBoardSubViewModel of the whiteboard of the file
destroySuperBoardSubView
destroySuperBoardSubView(uniqueID: string|string[]): Promise<void>Parameters
| Name | Type | Description |
|---|---|---|
| uniqueID | string|string[] | Unique identifier of the ZegoSuperBoardSubView object |
Details
Available Since: v2.0.0
When to call
the call querySuperBoardSubViewList pull to list or superBoardSubViewModelList get called when the model number greater than zero.If you need to delete multiple super boards, the SDK version shall be 2.20.0 or later, and you should pass uniqueIDs in string[].
querySuperBoardSubViewList
querySuperBoardSubViewList(): Promise<ZegoSuperBoardSubViewModel[]>Pull down the whiteboard in the current room at one time, SDK internal will be associated with the file in the whiteboard file also loaded down, these whiteboard and file SDK internal processing mapping added to the ZegoSuperBoardSubView, external only need to use ZegoSuperBoardView.
When to call
the SDK and call it after logging in to the room.- Available since: v2.0.0
SuperBoardSubView list
getSuperBoardSubView
getSuperBoardSubView(uniqueID: string): ZegoSuperBoardSubViewImpl | nullParameters
| Name | Type | Description |
|---|---|---|
| uniqueID | string | Unique identifier of the ZegoSuperBoardSubView object |
- When to call: Initialize the SDK, enter the room successfully, get the SuperBoardSubView list after the call.
Limited to scenarios where SuperBoardView is not used (set by enableSuperBoardView
- Available since: v2.0.0
clearCache
clearCache(): void- Available since: v2.0.0
Calling time: Initialization, after entering the room, the SDK needs to call it actively before exiting the room to clean up the resources in the room
unInit
unInit(): void- When to call: When you need to reinitialize the SDK, you must first call unInit.
- Available since: v2.14.0
getSDKVersion
getSDKVersion(): stringObtain the SDK version number.
- Use cases: When the SDK is running, if the developer finds the discrepancy with the expected situation, the developer can submit the problem and related logs to the ZEGO technical personnel for locating the problem. The ZEGO technical personnel may need the SDK version information to assist locating the problem.
- When to call: It can be called at any time.
- Available since: v2.0.0
Version number of the SDK
getCustomizedConfig
getCustomizedConfig(key: ZegoSuperBoardCustomConfigKey): stringParameters
| Name | Type | Description |
|---|---|---|
| key | ZegoSuperBoardCustomConfigKey |
Details
Get the value of the set configuration item.
- When to call: After initializing the Superboard SDK, after calling setCustomizedConfig.
- Available since: 2.0.0
Return
Get the value of the configured configuration item.
on
on(event: K, callBack: ZegoEvent[K]): booleanParameters
| Name | Type | Description |
|---|---|---|
| event | K | Monitor event name |
| callBack | ZegoEvent[K] | Callback |
- Use cases: Relevant information can be obtained by registering a specified method, for example, by registering for a whiteboard switching notification event, you can listen to the UniqueID of the opposite end to switch the whiteboard in real time.
- When to call: After ZegSuperBoard SDK is initialized.
- Available since: v2.0.0
Return
Whether the registration is successful
off
Parameters
| Name | Type | Description |
|---|---|---|
| event | K | Need to unlisten event name |
| listener? | ZegoEvent[K] | Callback |
Details
The specified monitoring event can be deleted
- When to call: After initializing the ZegoSuperboard SDK and registering the listener event.
- Available since: 2.0.0
Return
Whether the cancellation was successful
getSuperBoardView
getSuperBoardView(): ZegoSuperBoardViewOpen the SuperBoardView mode to get the object.
- Use cases: SuperBoardView mode is turned on, use the method on the object to switch the whiteboard on the A side, and the B side will automatically synchronize.
- Default value: Get the object by default
- When to call: After initializing ZegoSuperboard SDK.
- Caution: If you use the enableSuperBoardView interface and set it to false, you cannot get the SuperBoardView object.
- Available since: 2.0.0
BoardView object
attachSuperBoardSubView
attachSuperBoardSubView(subView: ZegoSuperBoardSubView, parentDomID: string): Promise<void>Parameters
| Name | Type | Description |
|---|---|---|
| subView | ZegoSuperBoardSubView | The SuperBoardSubView object to mount |
| parentDomID | string | Parent container ID to mount point Note: Please make sure that when calling this method, the parent container ID really exists, and the physical pixels of width and height are not 0 |
Details
Manually add SuperBoardSubView to the view when the SuperBoardView mode is not turned on
- When to call: Initialize ZegoSuperBoard SDK and call the enableSuperBoardView interface and set it to false.
- Caution: The physical pixel width and height of the added target view must not be less than 0.
- Related callbacks: The operator side adds SuperBoardSubView to the view, and the other side can monitor it through remoteSuperBoardSubViewAdded.
- Available since: 2.0.0
setWhiteboardBackgroundColor
setWhiteboardBackgroundColor(color: string): booleanParameters
| Name | Type | Description |
|---|---|---|
| color | string | Background color |
Details
Set the background color of the whiteboard, such as setting the pure whiteboard to dust, etc.
- Default value: rgb(241, 243, 244)
- When to call: After ZegSuperBoard SDK is initialized.
- Caution: 1. Since the whiteboard is overlaid on the file, setting the background color of the whiteboard will obscure the file. 2. After setting the whiteboard background color, all whiteboard background colors in the room will take effect
- Available since: 2.0.0
Return
Set result
setDeferredRenderingTime
setDeferredRenderingTime(delay: number): voidParameters
| Name | Type | Description |
|---|---|---|
| delay | number | Delay rendering time, in milliseconds |
Details
Set the delay rendering time of the local SubView, and the synchronization of all SubView related content on the opposite side will be delayed, including the execution of the ZegoEvent related callback events triggered by it.
- Use cases: If the audio and video stream used is reposted via CDN. In the room, there is a delay time for the receiving end to receive audio and video streams and whiteboard file streams. Through this method, delay the execution of whiteboard-related synchronization to achieve "audio and video synchronization"
- When to call: After initializing ZegoSuperboard SDK.
- Caution: The synchronization of all SubView-related content on the peer end will be delayed, including the execution of ZegoEvent-related callback events triggered by it.
- Available since: 2.0.0
enableSyncScale
enableSyncScale(enable: boolean): voidParameters
| Name | Type | Description |
|---|---|---|
| enable | boolean |
Details
After enabling, you can send out the zoom of the local end. Whether the peer end wants to accept it, you need to enable the peer end to accept the zoom.
- Use cases: Synchronize the zooming of the whiteboard on the operating end and the receiving end.
- Default value: When this interface is not called to set the scene, the default configuration is false.
- When to call: After ZegSuperboard SDK is initialized.
- Caution: To achieve dual-ended zoom synchronization, you need to set enableSyncScale and enableResponseScale at the same time
- Related callbacks: scaling changes occur on the peer end, and the receiving end can monitor the changed parameters through remoteSuperBoardScaleChanged.
- Available since: 2.0.0
enableResponseScale
enableResponseScale(enable: boolean): voidParameters
| Name | Type | Description |
|---|---|---|
| enable | boolean | True represents scaling in response to other members in the room, false represents no response, default is false. |
Details
After it is turned on, it can respond to the zooming of other members in the room, provided that the peer end synchronizes the zooming to other members in the room.
- Use cases: Synchronize the zooming of the whiteboard on the operating end and the receiving end.
- Default value: When this interface is not called to set the scene, the default configuration is false.
- When to call: After ZegSuperboard SDK is initialized.
- Caution: To achieve dual-ended zoom synchronization, you need to set enableSyncScale and enableResponseScale at the same time
- Related callbacks: scaling changes occur on the peer end, and the receiving end can monitor the changed parameters through remoteSuperBoardScaleChanged.
- Available since: 2.0.0
enableHandwriting
enableHandwriting(enable: boolean): voidParameters
| Name | Type | Description |
|---|---|---|
| enable | boolean | Whether to enable handwirting effect |
Details
Set whether the whiteboard graffiti has a pen sharp effect. If set to true, the graffiti will have a pen sharp effect.
- Use cases: Adjust the thickness and shape of the strokes according to the speed of the graffiti drawing process to enhance the writing experience.
- Default value: false.
- When to call /Trigger: Initialize the SDK, after rendering the whiteboard.
- Available since: 2.0.0
isHandwritingEnabled
isHandwritingEnabled(): booleanWhen the currently used tool type is brush, call isHandwritingEnabled to get whether to enable the stroke effect.
- When to call: After ZegSuperBoard SDK is initialized.
- Available since: 2.0.0
Whether to turn on the stroke effect
setToolType
setToolType(tool: ZegoSuperBoardTool): booleanParameters
| Name | Type | Description |
|---|---|---|
| tool | ZegoSuperBoardTool | The board tool type. |
Details
Set the tool type to make the mouse have different functions and effects.
- Default value: The default value is 1, and the default tool is pen
- When to call: After ZegSuperBoard SDK is initialized.
- Available since: 2.0.0
Return
Whether the setting is successful
getToolType
getToolType(): ZegoWhiteboardTool | nullGet the type of whiteboard tool being used
- When to call: After initializing ZegoSuperBoard SDK.
- Available since: 2.0.0
If there is, return the type of tool in use, otherwise return null
setFontBold
setFontBold(bold: boolean): booleanParameters
| Name | Type | Description |
|---|---|---|
| bold | boolean | Whether to set the text bold |
Details
After selecting the type of text tool, calling setFontBold and setting it to true, the newly added text on the whiteboard is all bold.
- Default value: false
- When to call: After ZegSuperBoard SDK is initialized.
- Caution: Only the newly-added text after setting the text bold will have the bold effect. For example, the existing text on the whiteboard will not be changed to the bold effect.
- Available since: 2.0.0
Return
Set result
isFontBold
isFontBold(): booleanWhen the currently used tool type is text, call isFontBold to get whether to set the bold effect.
- When to call: After ZegSuperBoard SDK is initialized.
- Available since: 2.0.0
Whether it is a bold effect
setFontItalic
setFontItalic(italic: boolean): booleanParameters
| Name | Type | Description |
|---|---|---|
| italic | boolean |
Details
Set whether the text of the text tool is italicized.
- Default value: false
- When to call: After ZegSuperBoard SDK is initialized.
- Caution: Only the new text after calling will take effect. For example, the existing text on the whiteboard will not be changed.
- Available since: v2.0.0.
Return
Set result
isFontItalic
isFontItalic(): booleanWhen the currently used tool type is text, call isFontItalic to get whether to set the italic effect
- When to call: After ZegSuperBoard SDK is initialized.
- Available since: 2.0.0
Returns whether to set italics
setFontSize
setFontSize(fontSize: number): booleanParameters
| Name | Type | Description |
|---|---|---|
| fontSize | number | font size |
Details
Select the type of text tool, call setFontSize to set, the new text on the whiteboard is the size after setting.
- Default value: 24, the maximum value shall not exceed 100
- When to call: After ZegSuperBoard SDK is initialized.
- Caution: Only the new text after calling setFontSize will take effect. For example, the existing text on the whiteboard will not be changed to the font size.
- Available since: 2.0.0
Return
Set result
getFontSize
getFontSize(): numberWhen the currently used tool type is text, call getFontSize to get the font size of the current text tool.
- When to call: After ZegSuperBoard SDK is initialized.
- Available since: v2.0.0
Font size
setBrushSize
setBrushSize(size: number): booleanParameters
| Name | Type | Description |
|---|---|---|
| size | number | Brush thickness |
Details
Select the brush tool type, call setBrushSize to set the value, and the new graffiti thickness on the whiteboard is the set value.
- Default value: 6
- When to call: After ZegSuperBoard SDK is initialized.
- Caution: The newly added graffiti after only setting the brush thickness has a new thickness effect. For example, the graffiti on the whiteboard will not be changed to the thickness.
- Available since: 2.0.0
Return
Set result
getBrushSize
getBrushSize(): numberWhen the currently used tool type is text, call getBrushSize to get the brush thickness.
- When to call: After ZegSuperBoard SDK is initialized.
- Available since: 2.0.0
Brush thickness
setBrushColor
setBrushColor(color: string): booleanParameters
| Name | Type | Description |
|---|---|---|
| color | string | color |
Details
After selecting the brush tool type and calling setBrushColor, the new graffiti color on the whiteboard will take effect.
- Default value: #f54326
- When to call: After ZegSuperBoard SDK is initialized.
- Caution: Only the new graffiti after setting the pen color will take effect. If the graffiti already exists on the whiteboard before, it will not be changed to the color.
- Available since: v2.0.0
Return
Set result
getBrushColor
getBrushColor(): stringWhen the currently used tool type is brush, call getBrushColor to get the current brush color.
- When to call: After ZegSuperBoard SDK is initialized.
- Available since: 2.0.0
Pen color, hexadecimal RGBA
ZegoSuperBoardSubView
Methods
clearSelected
clearSelected(): voidbatch delete selected multiple primitives
- When to call: when there are primitives on the whiteboard, it can be used.
- Available since: 2.0.0 and above
getCurrentStep
getCurrentStep(): number- Available since: 2.0.0 and above.
When to call : after initializing ZegoSuperBoard SDK.
- Restrictions: Only dynamic PPT can be called
Animation steps for the current page number
getScaleFactor
getScaleFactor(): ZegoSuperBoardScaleModelAfter the current superBoardSubView is zoomed, get the zoom related information of the current superBoardSubView.
When to call : After initializing ZegoSuperBoard SDK, after scaling superBoardSubView.
- Available since: 2.0.0 and above
Current zoom information
reloadView
reloadView(options?: ReloadOptions): voidParameters
| Name | Type | Description |
|---|---|---|
| options | ReloadOptions | Reload configuration items |
Details
This method can be used to reload the SubView when the size of the mounted parent container is dynamically modified
When to call
ZegSuperBoard SDK is initialized.- Caution:
- Each time this interface is called, the entire SubView content will be redrawn, and the position will be adaptive in real time. In order to improve the interactive experience, it can be called with limited frequency.
- It is only supported to call this API to reload View when the browser zoom is 100%. Otherwise, the file may be displayed abnormally due to the conflict between the adaptive strategy of this API and the adaptive strategy caused by the second zoom of the browsing.
- Available since: 2.0.0 and above.
setScaleFactor
setScaleFactor(scaleFactor: number): voidParameters
| Name | Type | Description |
|---|---|---|
| scaleFactor | number | Scale factor, no less than 1 |
Details
zoom superBoardSubView.
- Default value: 1
- When to call: After initializing ZegoSuperBoard SDK.
- Caution: The setting takes effect only after the whiteboard has been mounted.
- Related callbacks: superBoardSubViewScaleChanged monitor remote zoom
- Available since: 2.0.0
- Restrictions: the zoom factor must not be less than 1. when the current whiteboard tool type is click, calling the zoom interface is invalid.
getExcelSheetNameList
getExcelSheetNameList(): Promise<string[]>Get the names of all sheet tables in this excel file.
- Use cases: When you need to display the sheet table of the excel file, use this method to get the names of all the sheet tables of the excel file.
- Caution: Return an empty list for non-excel file types.
- When to call: After createFile succeeds or the pull list succeeds.
- Available since: v2.0.0
List of Sheet names of Excel files
getThumbnailUrlList
getThumbnailUrlList(): Promise<string[]>If you need to display the preview screen of the file, you can get the corresponding preview image through this interface, and then click the preview image to turn the page
- Use cases: Display the preview screen of each page of the document
- When to call /Trigger: Called after the file is loaded, otherwise it returns an empty list.
- Available since: v2.0.0
- Restrictions: Only support PDF, PPT, dynamic PPT, H5 file format, other types return an empty list.
List of URL addresses of thumbnails of each page of the file
getPPTNotes
getPPTNotes(page: number): stringParameters
| Name | Type | Description |
|---|---|---|
| page | number | The specified page number, starting from 1 |
Details
Get the notes of the specified page number of the PPT.
- Use cases: Get the notes of the specified page number of the PPT.
- When to call: After the loadFile succeeds.
- Available since: v2.0.0
- Restrictions: Only support PPT, dynamic PPT file format, other types returns null.
Return
Notes on this page, if there are no notes, null will be returned
getModel
getModel(): ZegoSuperBoardSubViewModelGet the ZegoSuperBoardSubViewModel data corresponding to the whiteboard
- Use cases: Get the ZegoSuperBoardSubViewModel data corresponding to the whiteboard, such as the whiteboard ID, name, associated file ID, current zoom factor, etc.
When to call
ZegSuperBoard SDK is initialized.- Available since: v2.0.0
the ZegoSuperBoardSubViewModel data corresponding to the whiteboard
addText
addText(text: string, positionX: number, positionY: number): voidParameters
| Name | Type | Description |
|---|---|---|
| text | string | The string content of the text primitive to be added |
| positionX | number | The horizontal offset relative to the upper left corner of the viewport, such as 10, where the viewport refers to the writable area |
| positionY | number | The vertical offset relative to the upper left corner of the viewport, such as 10, where the viewport refers to the writable area |
Details
Add text in the whiteboard view, you can specify the location of the addition.
- Use cases: Adding text at the specified position of the SubView will create a new text primitive.
- When to call: his is called when currentSuperBoardSubView exists.
- Available since: v2.0.0
undo
undo(): voidUndo the last operation of the whiteboard.
- Use cases: Whiteboard related operations.
- Related APIs: redo.
- When to call: when currentSuperBoardSubView exists.
- Available since: v2.0.0.
redo
redo(): voidRestore the undone operation on the whiteboard.
- Use cases: Whiteboard related operations.
- Related APIs: undo.
- When to call: this is called when currentSuperBoardSubView exists.
- Available since: v2.0.0.
clearCurrentPage
clearCurrentPage(): voidClear the primitives on the current page of the whiteboard.
- Use cases: Whiteboard related operations.
- Related APIs: clearAllPage.
- When to call: this is called when currentSuperBoardSubView exists.
- Available since: v2.0.0
clearAllPage
clearAllPage(): voidClear the primitives on all page of the whiteboard.
- Use cases: Whiteboard related operations.
- Related APIs: clearCurrentPage.
- When to call: this is called when currentSuperBoardSubView exists.
- Available since: v2.0.0
setOperationMode
setOperationMode(mode: ZegoSuperBoardOperationMode): voidParameters
| Name | Type | Description |
|---|---|---|
| mode | ZegoSuperBoardOperationMode | operation mode |
Details
Set the operation mode of the current whiteboard, such as prohibiting the client's gesture operation on the whiteboard.Users can use bitwise or to set multiple modes at the same time. For example, when set to Zoom | Draw, it can support both zoom mode and drawing mode.
- Use cases: Normally, there is no need to call this method. When the toolType is set, the SDK will call this method to process the whiteboard. If you need to prohibit the client's gesture operation on the whiteboard, you can use this method to set it to None mode.
- Default value: Draw/zoom mode.
- Impacts on other APIs: When set to scroll mode, gestures will be recognized as scrolling, and when set to drawing mode, gestures will be recognized as drawing-related operations at this time.
- Caution: It can be called only when the currentSuperBoardSubView exists. You can use the getCurrentSuperBoardSubView() method to determine whether the currentSuperBoardSubView exists, otherwise it will not have any effect.
- When to call: this is called when currentSuperBoardSubView exists.
- Available since: v2.0.0
snapshot
snapshot(customData?: {userData: string}): Promise<ZegoWhiteboardViewSnapshotModel>Parameters
| Name | Type | Description |
|---|---|---|
| customData? | {userData: string} | Optional. The userData in the object is a transparent transmission parameter, which can be used to name the screenshot data or the only mark of multiple screenshot data. |
Details
Save all content in the current whiteboard view visible area in the picture.
- Available since: v2.0.0
flipToPage
flipToPage(targetPage: number): voidParameters
| Name | Type | Description |
|---|---|---|
| targetPage | number | The page number of the target page, starting from 1 |
Details
Jump to the specified page .
- Use cases: Specify a page number to jump.
- Caution: If it is a dynamic ppt or H5 file, the jump page may need to download pictures and animation resources, so frequent calls may cause it to take a long time to complete.
- Related callbacks: superBoardSubViewScrollChanged.
- Related APIs: flipToPrePage,flipToNextPage
- When to call: this is called when currentSuperBoardSubView exists.
- Available since: v2.0.0
flipToPrePage
flipToPrePage(): voidJump to the previous page.
- Caution: If it is a dynamic ppt or H5 file, the jump page may need to download pictures and animation resources, so frequent calls may cause it to take a long time to complete.
- Related callbacks: superBoardSubViewScrolled.
- Related APIs: flipToPage,flipToNextPage
- When to call: this is called when currentSuperBoardSubView exists.
- Available since: v2.0.0
flipToNextPage
flipToNextPage(): booleanJump to the next page.
- Caution: If it is a dynamic ppt or H5 file, the jump page may need to download pictures and animation resources, so frequent calls may cause it to take a long time to complete.
- Related callbacks: superBoardSubViewScrolled.
- Related APIs: flipToPage,flipToPrePage
- When to call: this is called when currentSuperBoardSubView exists.
- Available since: v2.0.0
preStep
preStep(): voidJump to the previous step animation
- Caution: Only for dynamic ppt or H5 files, otherwise it will not have any effect.
- Related APIs: nextStep.
- When to call: this is called when currentSuperBoardSubView exists.
- Available since: v2.0.0.
getCurrentPage
getCurrentPage(): numberGet the page number of the currently displayed content
- When to call: When using ZegoSuperBoardView, this is called when currentSuperBoardSubView exists. When not in use ZegoSuperBoardView, when superBoardSubViewModelList existence SuperBoardSubViewModel can be invoked.
- Available since: v2.0.0.
page number of the currently displayed content
nextStep
nextStep(): voidJump to the next step animation
- Caution: Only for dynamic ppt or H5 files, otherwise it will not have any effect.
- Related APIs: preStep.
- When to call: this is called when currentSuperBoardSubView exists.
- Available since: v2.0.0.
getPageCount
getPageCount(): numberGet the page number of the currently displayed content
- When to call: When using ZegoSuperBoardView, this is called when currentSuperBoardSubView exists. When not in use ZegoSuperBoardView, when superBoardSubViewModel superBoardSubViewModelList existence can be invoked.
- Available since: v2.0.0.
total number of pages
getVisibleSize
getVisibleSize(): SizeGet the size of the visible area of the file. For example, use a size of 1000x1000 to load a 64x64 picture. At this time, the size of the visible area is 64x64.
- Caution: If it is not a file whiteboard, 0 will be returned.
- When to call: this is called when currentSuperBoardSubView exists.
- Available since: v2.0.0.
The size of the visible area
getCurrentSheetName
getCurrentSheetName(): stringGet the name of the currently displayed sheet, if it is not excel, return null.
- When to call: this is called when currentSuperBoardSubView exists.
- Available since: v2.0.0.
name of the currently displayed sheet
addImage
addImage(type : ZegoSuperBoardViewImageType, positionX: number, positionY: number, address: File | string | { path: string }, listener: Function): Promise<string>Parameters
| Name | Type | Description |
|---|---|---|
| type | ZegoSuperBoardViewImageType | Picture type, currently supports normal pictures and custom graphics |
| positionX | number | The starting point of the image insertion position, the horizontal offset relative to the upper left corner of the viewport, such as 10, where the viewport refers to the writable area. Just pass 0 to the custom graphics directly. |
| positionY | number | The starting point of the image insertion position, relative to the vertical offset of the upper left corner of the viewport, such as 10, where the viewport refers to the writable area. Just pass 0 to the custom graphics directly. |
| address | File | string | { path: string } | Picture address, support local picture address and network picture address |
| listener | Function | Add picture result callback |
Details
Insert pictures into the whiteboard, directly insert into the whiteboard display or set custom graphics.
- Use cases: After setting the custom graphics, when the whiteboard tool is selected as the custom graphics, touching the whiteboard will draw the custom graphics passed in here.
- Caution: Supported image types: png/jpg/jpeg, when the type is ZegoWhiteboardViewImageGraphic, it supports local images and network images, and the image size limit is 10M. When the type is ZegoWhiteboardViewImageCustom, only network images are supported, and the image size limit is 500KB.
- When to call: this is called when currentSuperBoardSubView exists.
- Available since: v2.0.0 .
clearSelected
clearSelected(): voidSelect some primitives through the selection tool of the whiteboard, and call this method to delete the selected primitives.
- When to call: After getting the SuperBoardSubView list.
- Available since: v2.0.0.
setBackgroundImage
setBackgroundImage(address: File | string | { path: string }, mode: ZegoSuperBoardViewImageFitMode): Promise<string>Parameters
| Name | Type | Description |
|---|---|---|
| address | File | string | { path: string } | The background image path, local path or network path can be used (network image only supports https). Example: "xxxxxxxxxx.png", " ". |
| mode | ZegoSuperBoardViewImageFitMode | Background image fill mode |
Details
Set a background image to the whiteboard, support local path or network path, this background image will be synchronized to other users in the room.
- When to call: After Get the SuperBoardSubView list.
- Caution: SVG and GIF types of background images are supported only in version v2.17.0 and later.
- Available since: v2.0.0.
- Restrictions: Background image types only support JPG, JPEG, PNG, SVG, and GIF formats.
clearBackgroundImage
clearBackgroundImage(): voidClear the background image of the whiteboard, this action will be synchronized to other users in the room.
- When to call: Get the SuperBoardSubView list.
- Available since: v2.0.0.
stopPlayPPTVideo
stopPlayPPTVideo(): voidStop the video currently being played on the dynamic ppt page, generally used to stop the audio and video playback of the dynamic PPT file when switching files.
- When to call: Called during audio and video playback after the file has been successfully loaded.
- Available since: v2.0.0.
ZegoSuperBoardSubViewImpl
Methods
playMedia
playMedia(params: {id:string,ct?:number}): Promise<{code:number, message?:string} | boolean>Parameters
| Name | Type | Description |
|---|---|---|
| params | {id,ct?} | Accept the id value (#id) of the audio and video HTML element, and when it is a video, you can pass in the second parameter in seconds to control the progress of the video |
Details
The audio and video of the dynamic presentation file are played by passing in the ID of the audio and video HTML element, and the second parameter can be passed to specify the playback progress of the video when you need to control the video progress.
- Use cases: It is called when the audio and video in the passive dynamic presentation file cannot be played due to browser restrictions, and is generally used in conjunction with the onMediaPermission callback.
- When to call: It can be called when currentSuperBoardSubView exists.
- Available since: 2.12.0
switchSpeaker
switchSpeaker(label: string): Promise<{code:number, message?:string} | boolean>Parameters
| Name | Type | Description |
|---|---|---|
| label | string | The label value of the speaker device list information |
Details
Specifies the dynamic presentation file range by passing in the label of the speaker device to the device used for voice playback audio.
- Use cases: Dynamic presentation file range voice switching used by speaker devices.
- Default value: Before calling the interface, the speaker device specified by the system is used by default.
- When to call: It can be called when currentSuperBoardSubView exists.
- Caution: This interface is currently only supported by Google Chrome on PC.
- Available since: 2.9.0
ZegoSuperBoardView
Methods
getCurrentSuperBoardSubView
getCurrentSuperBoardSubView(): ZegoSuperBoardSubView | nullIf you need to perform page turning operations on the currently displayed superBoardSubView, etc., after obtaining the currently displayed superBoardSubView, call the page turning method on the superBoardSubView.
- When to call: After ZegSuperBoard SDK is initialized.
- Caution: Effective when the superBoardView mode is turned on.
- Available since: 2.0.0
Current display superBoardSubView
switchSuperBoardSubView
switchSuperBoardSubView(uniqueID: string, sheetIndex?: number): Promise<boolean>Parameters
| Name | Type | Description |
|---|---|---|
| uniqueID | string | Unique IDENTIFIER of the SuperBoardSubView |
| sheetIndex? | number | If the switch BoardSubView is an Excel file, you need to switch the specified sheet and input sheetIndex |
Details
Detailed description: switch to the specified SubView, multi-terminal synchronization.
Related callback: remoteSuperBoardSubViewSwitched.
Return
Operation result

