最近更新时间:2024.03.29 10:55:44
首次发布时间:2022.12.05 21:56:56
@protocol ByteWhiteBoardDelegate <NSObject>
核心事件回调, ByteWhiteBoardDelegate 协议包含了 ByteWhiteBoard 提供的回调方法,通过代理向应用程序上报一些运行时事件,主要反应相关 API 调用发生的结果以及状态。 Callback functions are thrown synchronously in a non-UI thread within the SDK. Therefore, you must not perform any time-consuming operations or direct UI operations within the callback function, as this may cause the app to crash.
- (void)byteWhiteBoard:(ByteWhiteBoard *)board onError:(ByteWhiteBoardErrorCode)code message:(NSString *)message;
当内部发生不可逆转测错误时回调。
传入参数
参数名 | 类型 | 说明 |
---|---|---|
board | ByteWhiteBoard * | - |
code | ByteWhiteBoardErrorCode | 错误码,详见 ByteWhiteBoardErrorCode |
message | NSString * | - |
- (void)byteWhiteBoard:(ByteWhiteBoard *)board onBoardLock:(BOOL)isLock reason:(ByteWhiteBoardLockBoardReason)reason;
当白板锁定状态发生改变时,将触发该回调。
传入参数
参数名 | 类型 | 说明 |
---|---|---|
board | ByteWhiteBoard * | - |
isLock | BOOL | 锁定状态 |
reason | ByteWhiteBoardLockBoardReason | 锁定原因,详见 ByteWhiteBoardLockBoardReason |
- (void)byteWhiteBoard:(ByteWhiteBoard *)board onCanUndoStateChanged:(BOOL)isCanUndo;
可撤销状态改变的回调。
传入参数
参数名 | 类型 | 说明 |
---|---|---|
board | ByteWhiteBoard * | - |
isCanUndo | BOOL | 可撤回状态,为 true 时可调用 undo 撤回前一步骤。 |
注意
用户对白板进行编辑,也包括调用 redo 和 undo 接,本端会收到本回调。
- (void)byteWhiteBoard:(ByteWhiteBoard *)board onCanRedoStateChanged:(BOOL)isCanRedo;
可重做状态改变的回调。
传入参数
参数名 | 类型 | 说明 |
---|---|---|
board | ByteWhiteBoard * | - |
isCanRedo | BOOL | 可撤回状态,为 true 时可调用 undo 撤回前一步骤。 |
注意
用户对白板进行编辑,也包括调用 redo 和 undo 接口,本端会收到本回调。
- (void)byteWhiteBoard:(ByteWhiteBoard *)board onCreatePagesProgress:(NSString *)userId pages: (NSArray<ByteWhiteBoardPageInfo*> *)pageInfos insertPageId:(NSString *)insertPageId progress:(CGFloat)progress totalCount:(NSInteger)count;
已创建一个新页面回调。
传入参数
参数名 | 类型 | 说明 |
---|---|---|
board | ByteWhiteBoard * | - |
userId | NSString * | 创建页面的用户 |
pageInfos | NSArray<ByteWhiteBoardPageInfo *> * | 刚创建的白板页面信息 |
insertPageId | NSString * | 指定页面的 pageId,新建页面将插入此页面之后, @deprecated since 1.6.1 |
progress | CGFloat | 创建进度 |
count | NSInteger | - |
注意
调用 createPages:index:isAutoFlip: 后,房间中所有用户将收到本回调。
- (void)byteWhiteBoard:(ByteWhiteBoard *)board onRemovePages:(NSString *)userId boardId:(NSInteger)boardId pages:(NSArray<NSString*> *)pageIDs ;
已删除页面回调。
传入参数
参数名 | 类型 | 说明 |
---|---|---|
board | ByteWhiteBoard * | - |
userId | NSString * | 移除页面的用户 |
boardId | NSInteger | 白板 ID |
pageIDs | NSArray<NSString *> * | 被删除页面 ID |
注意
调用 removePages:flip: 后,房间中所有用户将收到本回调。
- (void)byteWhiteBoard:(ByteWhiteBoard *)board onClearPage:(id)placeholder;
白板清空回调。 调用 clearPage 后,房间中所有用户将收到本回调。
传入参数
参数名 | 类型 | 说明 |
---|---|---|
board | ByteWhiteBoard * | - |
placeholder | id | 形式参数,无需关注 |
- (void)byteWhiteBoard:(ByteWhiteBoard *)board onPageIndexChanged:(int)current_index;
当前页发生改变时触发此回调,例如,翻页或删除操作。监听本回调及时更新 UI 画面。
传入参数
参数名 | 类型 | 说明 |
---|---|---|
board | ByteWhiteBoard * | - |
current_index | int | 当前页索引 |
注意
翻页,例如调用 flipPage: 或调用 removePages:flip: 后,在本端和远端触发本回调。
- (void)byteWhiteBoard:(ByteWhiteBoard *)board onPageCountChanged:(NSInteger) totalCount;
总页数发生改变时触发此回调,例如,创建新页面或删除操作。监听本回调及时更新 UI 画面。
传入参数
参数名 | 类型 | 说明 |
---|---|---|
board | ByteWhiteBoard * | - |
totalCount | NSInteger | 新的总页数 |
注意
成功调用 createPages:index:isAutoFlip: 或 removePages:flip: 后,在本端和远端触发本回调。
- (void)byteWhiteBoard:(ByteWhiteBoard *)board onPageBackgroundChanged:(NSString *)userId boardId:(NSInteger)boardId pageId:(NSString *)pageId backgroundInfo:(ByteWhiteBoardBackgroundInfo *)bk_info;
页面背景信息被修改时触发该回调。
传入参数
参数名 | 类型 | 说明 |
---|---|---|
board | ByteWhiteBoard * | - |
userId | NSString * | 设置页面背景的用户 |
boardId | NSInteger | 白板 ID |
pageId | NSString * | 被修改的页面 ID |
bk_info | ByteWhiteBoardBackgroundInfo * | 页面背景设置。详见 ByteWhiteBoardBackgroundInfo |
注意
调用 setPageBackground: 后,房间中所有用户将收到本回调。
- (void)byteWhiteBoard:(ByteWhiteBoard *)board onBoardBackgroundChanged:(NSString *)userId boardId:(NSInteger)boardId boardBackgroundInfo:(ByteWhiteBoardBackgroundInfo *)bk_info;
白板背景信息被修改时触发该回调。
传入参数
参数名 | 类型 | 说明 |
---|---|---|
board | ByteWhiteBoard * | - |
userId | NSString * | 设置白板背景的用户 |
boardId | NSInteger | 被修改的白板 ID |
bk_info | ByteWhiteBoardBackgroundInfo * | 白板背景设置 |
注意
- (void)byteWhiteBoard:(ByteWhiteBoard *)board onZoomInfoChanged:(CGFloat)zoom offstX:(NSInteger)centerX offstY:(NSInteger) centerY;
当前白板的缩放信息改变时通知,以便更新 UI
传入参数
参数名 | 类型 | 说明 |
---|---|---|
board | ByteWhiteBoard * | - |
zoom | CGFloat | 缩放比例 [1-20], 1 表示 100% |
centerX | NSInteger | 视角中心点 x 坐标,默认为 0 |
centerY | NSInteger | 视角中心点 y 坐标,默认为 0 |
注意
成功调用 zoomTo:Y:X: 或 resetZoom 后,在本端和远端触发本回调。
- (void)byteWhiteBoard:(ByteWhiteBoard *)board onExportSnapshot:(NSString *)filePath;
保存当前页的快照。
传入参数
参数名 | 类型 | 说明 |
---|---|---|
board | ByteWhiteBoard * | - |
filePath | NSString * | 图片在本设备的存储绝对路径 |
注意
成功调用 exportSnapshot:withElements:withBackGround: 后,在本端触发本回调。
- (void)byteWhiteBoard:(ByteWhiteBoard *)board onImageLoading:(ByteWhiteBoardImageLoadStatus)status pageId:(NSString *)pageId boardId:(NSInteger)boardId imageUrl:(NSString *)url;
加载画面回调。
传入参数
参数名 | 类型 | 说明 |
---|---|---|
board | ByteWhiteBoard * | - |
status | ByteWhiteBoardImageLoadStatus | 图片加载状态。详见 ByteWhiteBoardImageLoadStatus |
pageId | NSString * | 页面 ID |
boardId | NSInteger | 白板 ID |
url | NSString * | 图片 URL 地址 |
- (void)byteWhiteBoard:(ByteWhiteBoard *)board onPptStepChanged:(NSString *)userId currentStep:(NSInteger)step totalStep:(NSInteger)total currentPageIndex:(NSInteger)index;
PPT 当前动画步数改变。任何与 PPT 动画步数相关事件发生时,都会触发本回调。
传入参数
参数名 | 类型 | 说明 |
---|---|---|
board | ByteWhiteBoard * | - |
userId | NSString * | 操作 PPT 并触发动画步数变化的用户 |
step | NSInteger | PPT 当前动画步数 |
total | NSInteger | 当前 PPT 页面的所有动画数 |
index | NSInteger | 当前页索引 |
@protocol ByteWhiteBoardRoomDelegate <NSObject>
回调
- (void)byteWhiteBoardRoom:(ByteWhiteBoardRoom *)boardRoom onError:(ByteWhiteBoardErrorCode)code message:(NSString *)message;
当内部发生错误信息时回调该事件。
传入参数
参数名 | 类型 | 说明 |
---|---|---|
boardRoom | ByteWhiteBoardRoom * | - |
code | ByteWhiteBoardErrorCode | 错误码,详见 ByteWhiteBoardErrorCode |
message | NSString * | 错误提示 |
- (void)byteWhiteBoardRoom:(ByteWhiteBoardRoom *)boardRoom onCreateWhiteBoard:(NSString *)userId boardId:(NSInteger)boardId whiteboard:(ByteWhiteBoard *)board pptInfo:(ByteWhiteBoardPptInfo *)pptInfo;
白板创建回调。
传入参数
参数名 | 类型 | 说明 |
---|---|---|
boardRoom | ByteWhiteBoardRoom * | - |
userId | NSString * | 创建白板的用户 ID |
boardId | NSInteger | 白板 ID |
board | ByteWhiteBoard * | 刚创建的白板对象 |
pptInfo | ByteWhiteBoardPptInfo * | 白板中ppt的信息,为 nil 表示普通白板。详见 ByteWhiteBoardPptInfo。 |
注意
调用 createWhiteBoard:pageInfo:backgroundInfo:boardName: 或 createFileWhiteBoard:boardName:pptInfo: 成功创建白板后,房间内所有用户收到本回调。
- (void)byteWhiteBoardRoom:(ByteWhiteBoardRoom *)boardRoom onRemoveWhiteBoard:(NSString *)userId boardId:(NSInteger)boardId pptInfo:(ByteWhiteBoardPptInfo *)pptInfo;
白板被删除时,房间内其他用户收到本回调。
传入参数
参数名 | 类型 | 说明 |
---|---|---|
boardRoom | ByteWhiteBoardRoom * | - |
userId | NSString * | 删除白板的用户 ID |
boardId | NSInteger | 被删除的白板 ID |
pptInfo | ByteWhiteBoardPptInfo * | 被删除白板对应的 PPT 信息,为 nil 表示普通白板。详见 ByteWhiteBoardPptInfo。 |
注意
删除白板的接口是 removeWhiteBoard:。
- (void)byteWhiteBoardRoom:(ByteWhiteBoardRoom *)boardRoom onCurrentWhiteBoardChanged:(NSString *)userId activeBoard:(NSInteger)activeBoardId whiteboard:(ByteWhiteBoard *)board;
当前白板切换时,房间内其他用户收到本回调。
传入参数
参数名 | 类型 | 说明 |
---|---|---|
boardRoom | ByteWhiteBoardRoom * | - |
userId | NSString * | 更换白板的用户 ID |
activeBoardId | NSInteger | 当前白板 ID |
board | ByteWhiteBoard * | - |
注意
切换当前白板的的接口是 switchWhiteBoard:。
- (void)byteWhiteBoardRoom:(ByteWhiteBoardRoom *)boardRoom onPlaybackDataLoaded:(int64_t)startTimestamp finish:(int64_t)endTimestamp;
回放录像加载成功回调。
传入参数
参数名 | 类型 | 说明 |
---|---|---|
boardRoom | ByteWhiteBoardRoom * | - |
startTimestamp | int64_t | 回放开始时间,为精确到毫秒的 UNIX 时间戳 |
endTimestamp | int64_t | 回放结束时间,为精确到毫秒的 UNIX 时间戳 |
- (void)byteWhiteBoardRoom:(ByteWhiteBoardRoom *)boardRoom onPlaybackStateChanged:(NSInteger)state reason:(NSInteger)code;
当白板录像播放状态发生改变时触发此回调。
传入参数
参数名 | 类型 | 说明 |
---|---|---|
boardRoom | ByteWhiteBoardRoom * | - |
state | NSInteger | 当前状态码
|
code | NSInteger | 状态切换原因
|
- (void)byteWhiteBoardRoom:(ByteWhiteBoardRoom *)boardRoom onPlaybackProgressUpdate:(CGFloat)progress duration:(CGFloat)duration;
白板录像播放进度回调。 调用 startPlayback 后触发本回调 200 ms 一次。
传入参数
参数名 | 类型 | 说明 |
---|---|---|
boardRoom | ByteWhiteBoardRoom * | - |
progress | CGFloat | 播放进度,单位 s |
duration | CGFloat | 总播放时长,单位 s |
- (void)byteWhiteBoardRoom:(ByteWhiteBoardRoom *)boardRoom onConnectionStateChanged:(ByteWhiteBoardConnectionState)state;
SDK 与信令服务器连接状态回调。当 SDK 与信令服务器的网络连接状态改变时触发。
传入参数
参数名 | 类型 | 说明 |
---|---|---|
boardRoom | ByteWhiteBoardRoom * | - |
state | ByteWhiteBoardConnectionState | 当前 SDK 与信令服务器连接状态。 详细定义参见 ByteWhiteBoardConnectionState。 |
注意
更多信息参见 连接状态提示。