Class
ZegoCreateFileConfig
Details
The interface parameters are used to construct the class, passing in the parameters needed to create the file.
- Use cases: The createFileView interface is needed in the call.
Properties
fileID
fileID: string ID of the file
Required or not: Mandatory
- Available since: v2.0.0
ZegoCreateWhiteboardConfig
Details
The interface parameters are used to construct the class with the parameters that are passed in to create the whiteboard.
- Use cases: In the call to createWhiteboardView the interface is passed in.
Properties
name
name: string Create whiteboard Is the name of the whiteboard to be set.
Required or not: Mandatory
Value range value can contain 128 bytes and can be in Both Chinese and English.
- Available since: v2.0.0
perPageWidth
perPageWidth: number Width of each whiteboard page.
Required or not: Mandatory
- Value range: Positive integer greater than 0.
- Available since: 2.0.0及以上
perPageHeight
perPageHeight: number Height of each whiteboard page.
Required or not: Mandatory
- Value range: Positive integer greater than 0.
- Available since: v2.0.0
pageCount
pageCount: number Total number of pages。
Required or not: Mandatory
- Value range: Greater than 0.
- Available since: v2.0.0
ZegoSuperBoardApiCalledCallbackModel
Details
After calling some interfaces of ZegoSuperBoardManager and ZegoSuperBoardSubView, the calling result of this interface will be called back through the general callback interface.
- Use cases: After calling the ZegoSuperBoardManager and ZegoSuperBoardSubView interfaces, judge whether the interface call is successful.
Properties
errorCode
ZegoSuperBoardCursorAttribute
Details
Detailed description: The interface parameter construction class uses the parameters required by the incoming cursor style.
Business scenario: It needs to be passed when calling the [setCustomCursorAttribute:cursorAttribute:complete:] interface.
Properties
iconPath
offsetX
offsetX: number - Default value: 0 Supported version: v2.4.0
offsetY
offsetY: number - Default value: 18 Supported version: v2.4.0
titleStyle
titleStyle: ZegoSuperBoardCursorTitleStyle - Default value: Refer to ZegoSuperBoardCursorTitleStyle class Supported version: v2.4.0
ZegoSuperBoardInitConfig
Details
The interface parameters are used to construct the class, and the parameters needed to initialize the SDK are initialized with the constructs.
- Use cases: The init SDK interface initWithConfig needs to be passed in.
Properties
appID
appID: number ZEGO application ID for developers, please apply from ZEGO management console.
Required or not: Mandatory
Reference range: 0-4294967295.
token
token: string The login verification token is obtained by registering the project in the instant console to obtain the key plus the specified algorithm. The test phase can be obtained through the interface provided by ZEGO, and the formal environment must be implemented by the user.
userID
userID: string User ID, please do not fill in sensitive user information in this field, including but not limited to mobile phone number, ID number, passport number, real name, etc.
appSign
appSign: string - Value range: Detailed description: Value range: '0' ~ '9', 'a' ~ 'z'. Example: "9dc9a25bh2f2137446897071c8c033fa33b91c3dd2a85e0c000ae82c0dad3". Version 2.3.0 and above appSign allows to pass blank or no pass. If it is empty or not passed, you can pass the token for initialization.please refer to Using Token Authentication.
cacheFolder
cacheFolder: string cache directory
logFolder
logFolder: string log directory
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.
forceReload
forceReload: boolean Set whether to force refresh.
- Use cases: When the rendering of the file on some iOS mobile devices is abnormal, execute this API to reload the file.
- Required: YES.
reloadType
reloadType: reloadType This configuration can be configured for the scope of the release canvas
- Required: YES.
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
clearLog
clearLog(): Promise<{ code: number }>Upload and clear the local cache log
- Available since: 2.4.0
Operation results
enableCustomCursor
enableCustomCursor(enable: boolean): voidParameters
| Name | Type | Description |
|---|---|---|
| enable | boolean | Whether to open |
Details
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
Required or not: Yes.
Call timing: After the SDK is initialized.
getInstance
getInstance(): ZegoSuperBoardManager- When to call /Trigger: After integrating ZegoSuperBoard SDK, before initializing ZegoSuperBoard SDK.
ZegoSuperBoardManager instance object
getSuperBoardSubViewModelList
getSuperBoardSubViewModelList(): List<ZegoSuperBoardSubViewModel>Through superBoardSubViewModelList, access to the current existing superBoardSubView room number and superBoardSubView information.
- Use cases: After entering the room, you need to obtain the superBoardSubView list in the room for display, and switch the current superBoardSubView in the list.
- When to call /Trigger: After initializing ZegoSuperboard SDK.
Information of superBoardSubView saved by the SDK
isEnabledCustomCursor
isEnabledCustomCursor(): booleanDetailed description: Whether to turn on the cursor display
Calling time: After initializing the SDK.
Whether to turn on the cursor display
isEnabledResponseScale
isEnabledResponseScale(): booleanGet whether it will respond to the zoom factor synchronized by other users
- When to call: this is called when currentSuperBoardSubView exists.
whether it will respond to the zoom factor synchronized by other users
isEnabledSyncScale
isEnabledSyncScale(): booleanGet whether the current zoom factor will be synchronized to others
- When to call: this is called when currentSuperBoardSubView exists.
whether the current zoom factor will be synchronized to others
isEnabledRemoteCursorVisible
isEnabledRemoteCursorVisible(): booleanDetailed description: Whether the remote cursor is on
Required or not: Yes.
Calling time: After initializing the SDK.
Whether the remote cursor is on
setContainerView
setContainerView(): Promise<void>Details: Transfer the whiteboard area of the file to be mounted to the SDK. Call time: after the SDK is initialized and the room is successfully logged in
setCustomCursorAttribute
setCustomCursorAttribute(type: ZegoSuperBoardTool, attr: ZegoSuperBoardCursorAttribute): Promise<ZegoSuperBoardApiCalledCallbackModel>Parameters
| Name | Type | Description |
|---|---|---|
| type | ZegoSuperBoardTool | Set the tool type, currently only supports setting the brush style |
| attr | ZegoSuperBoardCursorAttribute | Custom cursor related attributes |
Details
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.
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
uploadFile
uploadFile(filePath: string, renderType: ZegoSuperBoardRenderType): Promise<void>Parameters
| Name | Type | Description |
|---|---|---|
| filePath | string | The absolute path of the files to be uploaded can be PPT, PDF, XLS, JPG, JPEG, PNG, BMP, and TXT files. For details, please refer to File specifications. |
| renderType | ZegoSuperBoardRenderType | After the upload file transcoding rendering mode type, suggest set to VectorAndIMG, see ZegoSuperBoardRenderType. |
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.
- Caution: There will be multiple callbacks during the upload phase, please refer to the definition of ZegoSuperBoardUploadFileState for details
- When to call /Trigger: After ZegSuperBoard SDK is initialized.
Return
Return the request seq to upload the file
cancelUploadFile
cancelUploadFile(seq: number): Promise<ZegoSuperBoardApiCalledCallbackModel>Parameters
| Name | Type | Description |
|---|---|---|
| seq | number | Upload seq returned when uploadFile is called. |
Details
To cancel the file upload operation, the seQ 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.cacheFile
cacheFile(fileID: string): Promise<ZegoSuperBoardApiCalledCallbackModel>Parameters
| Name | Type | Description |
|---|---|---|
| fileID | string | The fileID to be cached. |
Details
You can save the corresponding file to the local.
- Use cases: Save the file to the local directory. You do not need to request the network to open the file next time, which improves the opening speed.
- When to call: You need to call it after initWithConfig.
Return
Operation results
cancelCacheFile
cancelCacheFile(seq: ZegoSuperBoardSeq): booleanParameters
| Name | Type | Description |
|---|---|---|
| seq | ZegoSuperBoardSeq | The sequence number of caching operation. |
Details
You can cancel the operation that is caching the file. You need to pass in the seQ corresponding to the operation of caching the file. After canceling the operation, the file will not be cached locally.
- 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: You need to call it after initWithConfig.
- Related APIs: cacheFile.
- Available since: v2.0.0
Return
Operation results
queryFileCached
queryFileCached(fileID: string): Promise<ZegoSuperBoardQueryCachedModel>Parameters
| Name | Type | Description |
|---|---|---|
| fileID | string | The ID of the file to be queried. |
Details
The ID of the corresponding file can be used to check whether the file has been cached locally.
- Use cases: None Example Query whether the file cache exists.
- When to call: You need to call it after initWithConfig.
- Related APIs: cancelCacheFile.
uploadH5File
uploadH5File(filePath: string, config: ZegoSuperboardCustomH5Config): Promise<void>Parameters
| Name | Type | Description |
|---|---|---|
| filePath | string | Local path for custom courseware |
| config | ZegoSuperboardCustomH5Config | Configuration of H5 courseware customization |
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.
Return
Return the uploaded file information
setCustomFontFromAsset
setCustomFontFromAsset(regularAssetPath: string, boldAssetPath: string): voidParameters
| Name | Type | Description |
|---|---|---|
| regularAssetPath | string | Font name of regular font. Please contact technical support to obtain the font. |
| boldAssetPath | string | Font name of the bold font. Please contact technical support to obtain the font. |
Details
You need to set a new custom font style for the text tool on the whiteboard.
- Use cases: Set custom new fonts.
- When to call: This is called after the whiteboard or file has been created.
- Caution: Only specific fonts are supported, and the font files provided by us need to be built into the project, please contact technical support to obtain the font file and the corresponding font name.
init
init(config: ZegoSuperBoardInitConfig): Promise<ZegoSuperBoardApiCalledCallbackModel>Parameters
| Name | Type | Description |
|---|---|---|
| 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
- Related APIs: unInit.
Return
Initialization result callback
setCustomizedConfig
setCustomizedConfig(key: ZegoSuperBoardCustomConfigKey, value: string): Promise<void>Parameters
| Name | Type | Description |
|---|---|---|
| key | ZegoSuperBoardCustomConfigKey | value description |
| value | string | key description |
- When to call: Called after initializing the Superboard SDK
Return
Whether the setting is successful
enableSuperBoardView
enableSuperBoardView(enable: boolean): Promise<void>Parameters
| 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
createWhiteboardView
createWhiteboardView(config: ZegoCreateWhiteboardConfig): Promise<ZegoSuperBoardViewCreatedCallbackModel>Parameters
| Name | Type | Description |
|---|---|---|
| config | ZegoCreateWhiteboardConfig | Pure Whiteboard configuration parameters |
- When to call: After initializing the ZegoSuperboard SDK, calling [loginRoom] to log in to the room, when you need to create a pure whiteboard.
createFileView
createFileView(config: ZegoCreateFileConfig): Promise<ZegoSuperBoardViewCreatedCallbackModel>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.
destroySuperBoardSubView
destroySuperBoardSubView(uniqueID: string): Promise<ZegoSuperBoardApiCalledCallbackModel>Parameters
| Name | Type | Description |
|---|---|---|
| uniqueID | string | Unique identifier of the ZegoSuperBoardSubView object |
Details
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 in batches, please execute serially
querySuperBoardSubViewList
querySuperBoardSubViewList(): Promise<ZegoSuperBoardQueryListCallbackModel>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.clearCache
clearCache(): Promise<void>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.
clear
clear(): voidWhen checking out, you need to clear the cache information in the room and stop media playback.
- When to call: You need to call it before you check out.
unInit
unInit(): void- When to call: When you need to reinitialize the SDK, you must first call unInit.
- Available since: v2.0.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.
- Developers can also collect this information as the VERSION information of the SDK used by the App, so as to make statistics of the SDK corresponding to each version of the App online.
- When to call: It can be called at any time.
- Available since: v2.0.0
Version number of the SDK
getCustomizedConfig
getCustomizedConfig(key: ZegoSuperBoardCustomConfigKey): Promise<string>Parameters
| 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.
on
on(event: K, callBack: ZegoEvent[K]): voidParameters
| 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.
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.
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
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(): Promise<boolean>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): Promise<boolean>Parameters
| 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
isEnabledHandwriting
isEnabledHandwriting(): Promise<boolean>When 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): Promise<void>Parameters
| 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
getToolType
getToolType(): Promise<ZegoSuperBoardTool>Get 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): Promise<void>Parameters
| 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(): Promise<boolean>When 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): Promise<void>Parameters
| 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(): Promise<boolean>When 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): Promise<void>Parameters
| 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(): Promise<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): Promise<void>Parameters
| 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(): Promise<number>When 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): Promise<void>Parameters
| 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(): Promise<string>When 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
ZegoSuperBoardQueryListCallbackModel
Details
Detailed description: data model class, which contains the name of the created ZegoSuperboardSubView, the creation time, the file ID contained, the file type and the unique identifier of the ZegoSuperboardSubView object.
Business scenario: The main user obtains the name and file information of the corresponding ZegoSuperboardSubView object.
Properties
errorCode
errorCode: ZegoSuperBoardError subViewModelList
subViewModelList: ZegoSuperBoardSubViewModel[] extraInfo
extraInfo: string 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
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.
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.
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.
- 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): Promise<string>Parameters
| 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.
- 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
getCurrentSuperBoardSubViewModel
getCurrentSuperBoardSubViewModel(): 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.the ZegoSuperBoardSubViewModel data corresponding to the whiteboard
inputText
inputText(): Promise<ZegoSuperBoardApiCalledCallbackModel>Add text to the whiteboard View, and an input box will pop up from the bottom of the whiteboard after calling.
- Use cases: Add text to the whiteboard View, and an input box will pop up from the bottom of the whiteboard after calling.
- Default value: The default content of the input box is "text", you can set the default text through [ZegoSuperBoardManager.setCustomText], the default display position is the middle of the current whiteboard range
- When to call: this is called when currentSuperBoardSubView exists.
undo
undo(): Promise<void>Undo the last operation of the whiteboard.
- Use cases: Whiteboard related operations.
- Related APIs: redo.
- When to call: when currentSuperBoardSubView exists.
redo
redo(): Promise<void>Restore the undone operation on the whiteboard.
- Use cases: Whiteboard related operations.
- Related APIs: undo.
- When to call: this is called when currentSuperBoardSubView exists.
clearCurrentPage
clearCurrentPage(): Promise<ZegoSuperBoardApiCalledCallbackModel>Clear 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.
Operation result callback. If deleting the primitives of the current page is successful, it will return success, otherwise it will fail
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): Promise<void>Parameters
| 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
flipToPage
flipToPage(targetPage: number): Promise<ZegoSuperBoardApiCalledCallbackModel>Parameters
| 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: scrollChange.
- Related APIs: flipToPrePage,flipToNextPage
- When to call: this is called when currentSuperBoardSubView exists.
flipToPrePage
flipToPrePage(): Promise<ZegoSuperBoardApiCalledCallbackModel>Jump 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: scrollChange.
- Related APIs: flipToPage,flipToNextPage
- When to call: this is called when currentSuperBoardSubView exists.
- Available since: v2.0.0
flipToNextPage
flipToNextPage(): Promise<ZegoSuperBoardApiCalledCallbackModel>Jump 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: scrollChange.
- Related APIs: flipToPage,flipToPrePage
- When to call: this is called when currentSuperBoardSubView exists.
- Available since: v2.0.0
preStep
preStep(): Promise<ZegoSuperBoardApiCalledCallbackModel>Jump 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.
nextStep
nextStep(): Promise<ZegoSuperBoardApiCalledCallbackModel>Jump 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(): Promise<number>Get 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
switchSuperBoardSubViewWithSheetIndex
switchSuperBoardSubViewWithSheetIndex(uniqueID: string, sheetIndex: number): Promise<ZegoSuperBoardApiCalledCallbackModel>Parameters
| Name | Type | Description |
|---|---|---|
| uniqueID | string | Unique IDENTIFIER of the SuperBoardSubView |
| sheetIndex | number | The index of the target sheet of the excel file |
Details
Switch the excel file to the specified sheet page.
- Use cases: When opening an excel file, the default is the 0th sheet page.
- When to call: this is called when currentSuperBoardSubView exists.
- Available since: v2.3.6
getVisibleSize
getVisibleSize(): ZegoSuperboardSizeGet 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(): Promise<string>Get 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, address: string, positionX: number, positionY: number): Promise<ZegoSuperBoardApiCalledCallbackModel>Parameters
| Name | Type | Description |
|---|---|---|
| type | ZegoSuperBoardViewImageType | Picture type, currently supports normal pictures and custom graphics |
| address | string | Picture address, supports local picture address and network picture address, local picture will be uploaded to CDN storage first. Currently, custom graphics only support network picture addresses. (Only https is supported for network pictures) Example: "xxxxxxxxxx.png", " ". |
| positionX | number | The starting point of the image insertion position, relative to the horizontal 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. |
| 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. |
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.
- Related callbacks: IZegoSuperBoardApiCalledCallback.
- When to call: this is called when currentSuperBoardSubView exists.
- Available since: v2.0.0 .
clearSelected
clearSelected(): Promise<ZegoSuperBoardApiCalledCallbackModel>Select 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.
setBackgroundImage
setBackgroundImage(address: string, mode: ZegoSuperBoardViewImageFitMode): Promise<ZegoSuperBoardApiCalledCallbackModel>Parameters
| Name | Type | Description |
|---|---|---|
| address | 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.
clearBackgroundImage
clearBackgroundImage(): Promise<ZegoSuperBoardApiCalledCallbackModel>Clear the background image of the whiteboard, this action will be synchronized to other users in the room.
- When to call: Get the SuperBoardSubView list.
stopPlayPPTVideo
stopPlayPPTVideo(): Promise<void>Stop 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.
setWhiteboardBackgroundColor
setWhiteboardBackgroundColor(color: string): Promise<void>Parameters
| 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
ZegoSuperBoardSubViewModel
Details
Data model class that contains the name of the ZegoSuperBoardSubView that was created, the time it was created, the ID of the contained file, the type of the file, and the unique identifier of the ZegoSuperBoardSubView object.
- Use cases: :The user obtains the ID, name and file information of the corresponding ZegoSuperBoardSubView object.
Properties
name
name: string Name of SuperBoardSubView
createTime
createTime: number Whiteboard Creation Time Unix timestamp (milliseconds)
fileID
fileID: string File ID, which is unique
fileType
uniqueID
uniqueID: string SuperBoardSubview ID, This ID is unique.
whiteboardIDList
whiteboardIDList: string[] A list of whiteboard IDs
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.
Current display superBoardSubView
switchSuperBoardSubView
switchSuperBoardSubView(uniqueID: string, sheetIndex?: number): Promise<ZegoSuperBoardApiCalledCallbackModel>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.
ZegoSuperBoardViewCreatedCallbackModel
Create the completion callback of SubView
Details
Supported version: v0.1.0.
Detailed description: After calling the createWhiteboardView and createFileView interfaces, the result of the creation will come out through this callback.
Business scenario: creating whiteboards and files.
Callback timing: Call the createWhiteboardView and createFileView interfaces.
Related interfaces: [createWhiteboardView], [createFileView]
Properties
errorCode
errorCode: number Error code, 0 means success
name
name: string Name of SuperBoardSubView
createTime
createTime: number Whiteboard Creation Time Unix timestamp (milliseconds)
fileID
fileID: string File ID, which is unique
fileType
fileType: number File type, refer to ZegoSuperBoardFileType
uniqueID
uniqueID: string SuperBoardSubview ID, This ID is unique.
whiteboardIDList
whiteboardIDList: string[] A list of whiteboard IDs
ZegoSuperboardCustomH5Config
Details
Custom H5 courseware property construction class can set the width, height, page number and thumbnail information of custom courseware.
- Use cases: It needs to be passed in the interface of uploading custom H5 courseware.
Properties
width
width: number Customize the width of H5 courseware
Required or not: Mandatory
- Value range: Greater than 0
height
height: number Customize the height of H5 courseware.
Required or not: Mandatory
- Value range: Greater than 0
pageCount
pageCount: number Customize the number of pages of H5 courseware.
thumbnailList
thumbnailList: string[] Customize H5 courseware thumbnail relative path array.
- Required: optional parameters
- Available since: 0.1.0


