You need to enable JavaScript to run this app.
导航

回调

最近更新时间2024.03.29 10:55:44

首次发布时间2022.12.05 21:56:56

ByteWhiteBoardDelegate
@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.

成员函数

返回名称
voidbyteWhiteBoard:onError:message:
voidbyteWhiteBoard:onBoardLock:reason:
voidbyteWhiteBoard:onCanUndoStateChanged:
voidbyteWhiteBoard:onCanRedoStateChanged:
voidbyteWhiteBoard:onCreatePagesProgress:pages:insertPageId:progress:totalCount:
voidbyteWhiteBoard:onRemovePages:boardId:pages:
voidbyteWhiteBoard:onClearPage:
voidbyteWhiteBoard:onPageIndexChanged:
voidbyteWhiteBoard:onPageCountChanged:
voidbyteWhiteBoard:onPageBackgroundChanged:boardId:pageId:backgroundInfo:
voidbyteWhiteBoard:onBoardBackgroundChanged:boardId:boardBackgroundInfo:
voidbyteWhiteBoard:onZoomInfoChanged:offstX:offstY:
voidbyteWhiteBoard:onExportSnapshot:
voidbyteWhiteBoard:onImageLoading:pageId:boardId:imageUrl:
voidbyteWhiteBoard:onPptStepChanged:currentStep:totalStep:currentPageIndex:

函数说明

byteWhiteBoard:onError:message:

- (void)byteWhiteBoard:(ByteWhiteBoard *)board onError:(ByteWhiteBoardErrorCode)code message:(NSString *)message;

当内部发生不可逆转测错误时回调。

传入参数

参数名类型说明
boardByteWhiteBoard *-
codeByteWhiteBoardErrorCode错误码,详见 ByteWhiteBoardErrorCode
messageNSString *-

byteWhiteBoard:onBoardLock:reason:

- (void)byteWhiteBoard:(ByteWhiteBoard *)board onBoardLock:(BOOL)isLock reason:(ByteWhiteBoardLockBoardReason)reason;

当白板锁定状态发生改变时,将触发该回调。

传入参数

参数名类型说明
boardByteWhiteBoard *-
isLockBOOL锁定状态
reasonByteWhiteBoardLockBoardReason锁定原因,详见 ByteWhiteBoardLockBoardReason

byteWhiteBoard:onCanUndoStateChanged:

- (void)byteWhiteBoard:(ByteWhiteBoard *)board onCanUndoStateChanged:(BOOL)isCanUndo;

可撤销状态改变的回调。

传入参数

参数名类型说明
boardByteWhiteBoard *-
isCanUndoBOOL可撤回状态,为 true 时可调用 undo 撤回前一步骤。

注意

用户对白板进行编辑,也包括调用 redoundo 接,本端会收到本回调。

byteWhiteBoard:onCanRedoStateChanged:

- (void)byteWhiteBoard:(ByteWhiteBoard *)board onCanRedoStateChanged:(BOOL)isCanRedo;

可重做状态改变的回调。

传入参数

参数名类型说明
boardByteWhiteBoard *-
isCanRedoBOOL可撤回状态,为 true 时可调用 undo 撤回前一步骤。

注意

用户对白板进行编辑,也包括调用 redoundo 接口,本端会收到本回调。

byteWhiteBoard:onCreatePagesProgress:pages:insertPageId:progress:totalCount:

- (void)byteWhiteBoard:(ByteWhiteBoard *)board onCreatePagesProgress:(NSString *)userId pages: (NSArray<ByteWhiteBoardPageInfo*> *)pageInfos insertPageId:(NSString *)insertPageId progress:(CGFloat)progress totalCount:(NSInteger)count;

已创建一个新页面回调。

传入参数

参数名类型说明
boardByteWhiteBoard *-
userIdNSString *创建页面的用户
pageInfosNSArray<ByteWhiteBoardPageInfo *> *刚创建的白板页面信息
insertPageIdNSString *指定页面的 pageId,新建页面将插入此页面之后, @deprecated since 1.6.1
progressCGFloat创建进度
countNSInteger-

注意

调用 createPages:index:isAutoFlip: 后,房间中所有用户将收到本回调。

byteWhiteBoard:onRemovePages:boardId:pages:

- (void)byteWhiteBoard:(ByteWhiteBoard *)board onRemovePages:(NSString *)userId boardId:(NSInteger)boardId pages:(NSArray<NSString*> *)pageIDs ;

已删除页面回调。

传入参数

参数名类型说明
boardByteWhiteBoard *-
userIdNSString *移除页面的用户
boardIdNSInteger白板 ID
pageIDsNSArray<NSString *> *被删除页面 ID

注意

调用 removePages:flip: 后,房间中所有用户将收到本回调。

byteWhiteBoard:onClearPage:

- (void)byteWhiteBoard:(ByteWhiteBoard *)board onClearPage:(id)placeholder;

白板清空回调。 调用 clearPage 后,房间中所有用户将收到本回调。

传入参数

参数名类型说明
boardByteWhiteBoard *-
placeholderid形式参数,无需关注

byteWhiteBoard:onPageIndexChanged:

- (void)byteWhiteBoard:(ByteWhiteBoard *)board onPageIndexChanged:(int)current_index;

当前页发生改变时触发此回调,例如,翻页或删除操作。监听本回调及时更新 UI 画面。

传入参数

参数名类型说明
boardByteWhiteBoard *-
current_indexint当前页索引

注意

翻页,例如调用 flipPage: 或调用 removePages:flip: 后,在本端和远端触发本回调。

byteWhiteBoard:onPageCountChanged:

- (void)byteWhiteBoard:(ByteWhiteBoard *)board onPageCountChanged:(NSInteger) totalCount;

总页数发生改变时触发此回调,例如,创建新页面或删除操作。监听本回调及时更新 UI 画面。

传入参数

参数名类型说明
boardByteWhiteBoard *-
totalCountNSInteger新的总页数

注意

成功调用 createPages:index:isAutoFlip:removePages:flip: 后,在本端和远端触发本回调。

byteWhiteBoard:onPageBackgroundChanged:boardId:pageId:backgroundInfo:

- (void)byteWhiteBoard:(ByteWhiteBoard *)board onPageBackgroundChanged:(NSString *)userId boardId:(NSInteger)boardId pageId:(NSString *)pageId backgroundInfo:(ByteWhiteBoardBackgroundInfo *)bk_info;

页面背景信息被修改时触发该回调。

传入参数

参数名类型说明
boardByteWhiteBoard *-
userIdNSString *设置页面背景的用户
boardIdNSInteger白板 ID
pageIdNSString *被修改的页面 ID
bk_infoByteWhiteBoardBackgroundInfo *页面背景设置。详见 ByteWhiteBoardBackgroundInfo

注意

调用 setPageBackground: 后,房间中所有用户将收到本回调。

byteWhiteBoard:onBoardBackgroundChanged:boardId:boardBackgroundInfo:

- (void)byteWhiteBoard:(ByteWhiteBoard *)board onBoardBackgroundChanged:(NSString *)userId boardId:(NSInteger)boardId boardBackgroundInfo:(ByteWhiteBoardBackgroundInfo *)bk_info;

白板背景信息被修改时触发该回调。

传入参数

参数名类型说明
boardByteWhiteBoard *-
userIdNSString *设置白板背景的用户
boardIdNSInteger被修改的白板 ID
bk_infoByteWhiteBoardBackgroundInfo *白板背景设置

注意

byteWhiteBoard:onZoomInfoChanged:offstX:offstY:

- (void)byteWhiteBoard:(ByteWhiteBoard *)board onZoomInfoChanged:(CGFloat)zoom offstX:(NSInteger)centerX offstY:(NSInteger) centerY;

当前白板的缩放信息改变时通知,以便更新 UI

传入参数

参数名类型说明
boardByteWhiteBoard *-
zoomCGFloat缩放比例 [1-20], 1 表示 100%
centerXNSInteger视角中心点 x 坐标,默认为 0
centerYNSInteger视角中心点 y 坐标,默认为 0

注意

成功调用 zoomTo:Y:X:resetZoom 后,在本端和远端触发本回调。

byteWhiteBoard:onExportSnapshot:

- (void)byteWhiteBoard:(ByteWhiteBoard *)board onExportSnapshot:(NSString *)filePath;

保存当前页的快照。

传入参数

参数名类型说明
boardByteWhiteBoard *-
filePathNSString *图片在本设备的存储绝对路径

注意

成功调用 exportSnapshot:withElements:withBackGround: 后,在本端触发本回调。

byteWhiteBoard:onImageLoading:pageId:boardId:imageUrl:

- (void)byteWhiteBoard:(ByteWhiteBoard *)board onImageLoading:(ByteWhiteBoardImageLoadStatus)status pageId:(NSString *)pageId boardId:(NSInteger)boardId imageUrl:(NSString *)url;

加载画面回调。

传入参数

参数名类型说明
boardByteWhiteBoard *-
statusByteWhiteBoardImageLoadStatus图片加载状态。详见 ByteWhiteBoardImageLoadStatus
pageIdNSString *页面 ID
boardIdNSInteger白板 ID
urlNSString *图片 URL 地址

byteWhiteBoard:onPptStepChanged:currentStep:totalStep:currentPageIndex:

- (void)byteWhiteBoard:(ByteWhiteBoard *)board onPptStepChanged:(NSString *)userId currentStep:(NSInteger)step totalStep:(NSInteger)total currentPageIndex:(NSInteger)index;

PPT 当前动画步数改变。任何与 PPT 动画步数相关事件发生时,都会触发本回调。

传入参数

参数名类型说明
boardByteWhiteBoard *-
userIdNSString *操作 PPT 并触发动画步数变化的用户
stepNSIntegerPPT 当前动画步数
totalNSInteger当前 PPT 页面的所有动画数
indexNSInteger当前页索引

ByteWhiteBoardRoomDelegate
@protocol ByteWhiteBoardRoomDelegate <NSObject>

回调

成员函数

返回名称
voidbyteWhiteBoardRoom:onError:message:
voidbyteWhiteBoardRoom:onCreateWhiteBoard:boardId:whiteboard:pptInfo:
voidbyteWhiteBoardRoom:onRemoveWhiteBoard:boardId:pptInfo:
voidbyteWhiteBoardRoom:onCurrentWhiteBoardChanged:activeBoard:whiteboard:
voidbyteWhiteBoardRoom:onPlaybackDataLoaded:finish:
voidbyteWhiteBoardRoom:onPlaybackStateChanged:reason:
voidbyteWhiteBoardRoom:onPlaybackProgressUpdate:duration:
voidbyteWhiteBoardRoom:onConnectionStateChanged:

函数说明

byteWhiteBoardRoom:onError:message:

- (void)byteWhiteBoardRoom:(ByteWhiteBoardRoom *)boardRoom onError:(ByteWhiteBoardErrorCode)code message:(NSString *)message;

当内部发生错误信息时回调该事件。

传入参数

参数名类型说明
boardRoomByteWhiteBoardRoom *-
codeByteWhiteBoardErrorCode错误码,详见 ByteWhiteBoardErrorCode
messageNSString *错误提示

byteWhiteBoardRoom:onCreateWhiteBoard:boardId:whiteboard:pptInfo:

- (void)byteWhiteBoardRoom:(ByteWhiteBoardRoom *)boardRoom onCreateWhiteBoard:(NSString *)userId boardId:(NSInteger)boardId whiteboard:(ByteWhiteBoard *)board pptInfo:(ByteWhiteBoardPptInfo *)pptInfo;

白板创建回调。

传入参数

参数名类型说明
boardRoomByteWhiteBoardRoom *-
userIdNSString *创建白板的用户 ID
boardIdNSInteger白板 ID
boardByteWhiteBoard *刚创建的白板对象
pptInfoByteWhiteBoardPptInfo *白板中ppt的信息,为 nil 表示普通白板。详见 ByteWhiteBoardPptInfo

注意

调用 createWhiteBoard:pageInfo:backgroundInfo:boardName:createFileWhiteBoard:boardName:pptInfo: 成功创建白板后,房间内所有用户收到本回调。

byteWhiteBoardRoom:onRemoveWhiteBoard:boardId:pptInfo:

- (void)byteWhiteBoardRoom:(ByteWhiteBoardRoom *)boardRoom onRemoveWhiteBoard:(NSString *)userId boardId:(NSInteger)boardId pptInfo:(ByteWhiteBoardPptInfo *)pptInfo;

白板被删除时,房间内其他用户收到本回调。

传入参数

参数名类型说明
boardRoomByteWhiteBoardRoom *-
userIdNSString *删除白板的用户 ID
boardIdNSInteger被删除的白板 ID
pptInfoByteWhiteBoardPptInfo *被删除白板对应的 PPT 信息,为 nil 表示普通白板。详见 ByteWhiteBoardPptInfo

注意

删除白板的接口是 removeWhiteBoard:

byteWhiteBoardRoom:onCurrentWhiteBoardChanged:activeBoard:whiteboard:

- (void)byteWhiteBoardRoom:(ByteWhiteBoardRoom *)boardRoom onCurrentWhiteBoardChanged:(NSString *)userId activeBoard:(NSInteger)activeBoardId whiteboard:(ByteWhiteBoard *)board;

当前白板切换时,房间内其他用户收到本回调。

传入参数

参数名类型说明
boardRoomByteWhiteBoardRoom *-
userIdNSString *更换白板的用户 ID
activeBoardIdNSInteger当前白板 ID
boardByteWhiteBoard *-

注意

切换当前白板的的接口是 switchWhiteBoard:

byteWhiteBoardRoom:onPlaybackDataLoaded:finish:

- (void)byteWhiteBoardRoom:(ByteWhiteBoardRoom *)boardRoom onPlaybackDataLoaded:(int64_t)startTimestamp finish:(int64_t)endTimestamp;

回放录像加载成功回调。

传入参数

参数名类型说明
boardRoomByteWhiteBoardRoom *-
startTimestampint64_t回放开始时间,为精确到毫秒的 UNIX 时间戳
endTimestampint64_t回放结束时间,为精确到毫秒的 UNIX 时间戳

byteWhiteBoardRoom:onPlaybackStateChanged:reason:

- (void)byteWhiteBoardRoom:(ByteWhiteBoardRoom *)boardRoom onPlaybackStateChanged:(NSInteger)state reason:(NSInteger)code;

当白板录像播放状态发生改变时触发此回调。

传入参数

参数名类型说明
boardRoomByteWhiteBoardRoom *-
stateNSInteger当前状态码
  • 0:初始化
  • 1:暂停播放
  • 2:开始播放
  • 3:停止状态
codeNSInteger状态切换原因
  • 0:用户或系统主动行为
  • 101:开始播放时资源加载
  • 102:seek 行为做数据准备
  • 601:播放结束
  • 602:数据为空
  • 603:数据错误
  • 604:数据下载失败

byteWhiteBoardRoom:onPlaybackProgressUpdate:duration:

- (void)byteWhiteBoardRoom:(ByteWhiteBoardRoom *)boardRoom onPlaybackProgressUpdate:(CGFloat)progress duration:(CGFloat)duration;

白板录像播放进度回调。 调用 startPlayback 后触发本回调 200 ms 一次。

传入参数

参数名类型说明
boardRoomByteWhiteBoardRoom *-
progressCGFloat播放进度,单位 s
durationCGFloat总播放时长,单位 s

byteWhiteBoardRoom:onConnectionStateChanged:

- (void)byteWhiteBoardRoom:(ByteWhiteBoardRoom *)boardRoom onConnectionStateChanged:(ByteWhiteBoardConnectionState)state;

SDK 与信令服务器连接状态回调。当 SDK 与信令服务器的网络连接状态改变时触发。

传入参数

参数名类型说明
boardRoomByteWhiteBoardRoom *-
stateByteWhiteBoardConnectionState当前 SDK 与信令服务器连接状态。 详细定义参见 ByteWhiteBoardConnectionState

注意

更多信息参见 连接状态提示