ByteWhiteBoardDelegate
@protocol ByteWhiteBoardDelegate <NSObject>
objectivec

ByteWhiteBoardDelegate 协议包含了ByteWhiteBoard SDK提供的回调方法,SDK通过代理向应用程序上报一些运行时事件,主要用来给业务方提供必要的回调,反应相关API调用发生的结果以及sdk状态。

成员函数
返回名称
voidbyteWhiteBoard:onOccurWarning:
voidbyteWhiteBoard:onOccurError:
voidbyteWhiteBoard:onInitBoard:currentPageID:boardStatus:
voidbyteWhiteBoard:onLockBoard:reason:
voidbyteWhiteBoard:onCanUndoStateChanged:
voidbyteWhiteBoard:onCanRedoStateChanged:
voidbyteWhiteBoardAttachedToWindow:
voidbyteWhiteBoardDetachedToWindow:
voidbyteWhiteBoardClearPage:
voidbyteWhiteBoard:onPageIndexChanged:pageInfo:
voidbyteWhiteBoard:onCreatePages:pageInfos:
voidbyteWhiteBoard:onRemovePages:
voidbyteWhiteBoard:onPagesCountChanged:
voidbyteWhiteBoard:OnChangePageBackground:backgroundInfo:
voidbyteWhiteBoard:OnChangeBoardBackground:
函数说明

byteWhiteBoard:onOccurWarning:
- (void)byteWhiteBoard:(ByteWhiteBoard *)board onOccurWarning:(ByteWhiteBoardWarningCode)Code;
objectivec

当内部发生警告信息时回调该事件

传入参数

参数名类型说明
CodeByteWhiteBoardWarningCode警告码,详见 ByteWhiteBoardWarningCode

byteWhiteBoard:onOccurError:
- (void)byteWhiteBoard:(ByteWhiteBoard *)board onOccurError:(ByteWhiteBoardErrorCode)code;
objectivec

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

传入参数

参数名类型说明
codeByteWhiteBoardErrorCode错误码,详见 ByteWhiteBoardErrorCode

byteWhiteBoard:onInitBoard:currentPageID:boardStatus:
- (void)byteWhiteBoard:(ByteWhiteBoard *)board onInitBoard:(NSArray<ByteWhiteBoardPageInfo*>*)pages currentPageID:(NSString*)pageID boardStatus:(ByteWhiteBoardBoardStatus)status;
objectivec

白板初始化

传入参数

参数名类型说明
pagesNSArray<ByteWhiteBoardPageInfo>**所有白板页信息
pageIDNSString*当前页面 ID
statusByteWhiteBoardBoardStatus画板状态,是否已关闭。详见 ByteWhiteBoardBoardStatus

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

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

传入参数

参数名类型说明
isLockBOOL是否锁定
reasonByteWhiteBoardLockBoardReason锁定原因,详见 ByteWhiteBoardLockBoardReason

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

Undo 的状态回调,通知是否可以 Undo

传入参数

参数名类型说明
enableBOOL可撤回状态,为 true 时可调用 undo 撤回前一步骤

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

Redo 的状态回调,通知是否可以 Redo

传入参数

参数名类型说明
enableBOOL可重做状态,为 true 时可调用 redo 重复此前步骤。

byteWhiteBoardAttachedToWindow:
- (void)byteWhiteBoardAttachedToWindow:(ByteWhiteBoard *)board;
objectivec

白板绑定到 UI 控件。成功调用 bindToWindowWithConfig: 后收到此回调

传入参数

参数名类型说明
boardByteWhiteBoard*白板实例,详见 ByteWhiteBoard

byteWhiteBoardDetachedToWindow:
- (void)byteWhiteBoardDetachedToWindow:(ByteWhiteBoard *)board;
objectivec

白板解除和 UI 控件的绑定。成功调用 unbindFromWindow 后收到此回调

传入参数

参数名类型说明
boardByteWhiteBoard*白板实例

byteWhiteBoardClearPage:
- (void)byteWhiteBoardClearPage:(ByteWhiteBoard *)board;
objectivec

白板清空回调
调用 clearPage 后触发本回调。

传入参数

参数名类型说明
boardByteWhiteBoard*白板实例

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

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

传入参数

参数名类型说明
current_indexint当前页索引
pageInfoByteWhiteBoardPageInfo*当前页信息

注意
成功调用 flipPageflipPage: 或 removePage:RemovePage: 后,在本端和远端触发本回调。

byteWhiteBoard:onCreatePages:pageInfos:
- (void)byteWhiteBoard:(ByteWhiteBoard *)board onCreatePages:(NSString*)prePageID pageInfos:(NSArray<ByteWhiteBoardPageInfo*>*)pageInfos;
objectivec

已创建一个新页面回调

传入参数

参数名类型说明
prePageIDNSString*刚创建的白板页面 ID
pageInfosNSArray<ByteWhiteBoardPageInfo>**刚创建的白板页面信息

注意
调用 createPage:config:isAutoFlip: 后在本端和远端触发本回调。

byteWhiteBoard:onRemovePages:
- (void)byteWhiteBoard:(ByteWhiteBoard *)board onRemovePages:(NSArray<NSString*>*)pageIDs;
objectivec

删除页

传入参数

参数名类型说明
pageIDsNSArray<NSString>**被删除页面 ID

注意
调用 removePage:RemovePage: 后在本端和远端触发本回调。

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

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

传入参数

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

注意
成功调用 createPage:config:isAutoFlip: 或 removePage:RemovePage: 后,在本端和远端触发本回调。

byteWhiteBoard:OnChangePageBackground:backgroundInfo:
- (void)byteWhiteBoard:(ByteWhiteBoard *)board OnChangePageBackground:(NSString* )pageID backgroundInfo:(ByteWhiteBoardBackgroundInfo *)bk_info;
objectivec

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

传入参数

参数名类型说明
pageIDNSString*被修改的页面 ID
bk_infoByteWhiteBoardBackgroundInfo*背景信息

注意
调用 changePageBackgroundWhitPageID:bkInfo: 后在本端和远端触发本回调。

byteWhiteBoard:OnChangeBoardBackground:
- (void)byteWhiteBoard:(ByteWhiteBoard *)board OnChangeBoardBackground:(ByteWhiteBoardBackgroundInfo *)bk_info;
objectivec

修改白板默认背景回调。

传入参数

参数名类型说明
bk_infoByteWhiteBoardBackgroundInfo*背景信息

注意

ByteWhiteBoardRoomDelegate
@protocol ByteWhiteBoardRoomDelegate <NSObject>
objectivec

回调

成员函数
返回名称
voidbyteWhiteBoardRoom:onOccurWarning:
voidbyteWhiteBoardRoom:onOccurError:
voidbyteWhiteBoardRoom:onJoinRoomResult:userID:errCode:isRejoin:
voidbyteWhiteBoardRoom:onLeaveRoomResult:reason:
voidbyteWhiteBoardRoom:onPlaybackWhiteBoardStateChanged:errCode:
voidbyteWhiteBoardRoom:onPlaybackWhiteBoardProgressUpdate:duration:
voidbyteWhiteBoardRoom:onWhiteBoardCreated:elapsed:
函数说明

byteWhiteBoardRoom:onOccurWarning:
- (void)byteWhiteBoardRoom:(ByteWhiteBoardRoom *)boardRoom onOccurWarning:(ByteWhiteBoardWarningCode)code;
objectivec

当内部发生警告信息时回调该事件

传入参数

参数名类型说明
codeByteWhiteBoardWarningCode警告标识码,详见 ByteWhiteBoardWarningCode

byteWhiteBoardRoom:onOccurError:
- (void)byteWhiteBoardRoom:(ByteWhiteBoardRoom *)boardRoom onOccurError:(ByteWhiteBoardErrorCode)code;
objectivec

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

传入参数

参数名类型说明
codeByteWhiteBoardErrorCode错误标识码,详见 ByteWhiteBoardErrorCode

byteWhiteBoardRoom:onJoinRoomResult:userID:errCode:isRejoin:
- (void)byteWhiteBoardRoom:(ByteWhiteBoardRoom *)boardRoom onJoinRoomResult:(NSString *)roomID userID:(NSString *)userID errCode:(NSInteger)code isRejoin:(BOOL)rej;
objectivec

本端调用 joinRoom 进房的结果回调。

传入参数

参数名类型说明
roomIDNSString*房间 ID
userIDNSString*用户 ID
codeNSInteger进房的错误码。详见 ByteWhiteBoardErrorCode。
rejBOOLfalse:第一次进房;true: 断网重连加入

byteWhiteBoardRoom:onLeaveRoomResult:reason:
- (void)byteWhiteBoardRoom:(ByteWhiteBoardRoom *)boardRoom onLeaveRoomResult:(NSString *)roomID reason:(NSInteger)reason;
objectivec

本端调用 leaveRoom 的退房结果回调。

传入参数

参数名类型说明
roomIDNSString*房间ID
reasonNSInteger离房错误码。0: 成功。

byteWhiteBoardRoom:onPlaybackWhiteBoardStateChanged:errCode:
- (void)byteWhiteBoardRoom:(ByteWhiteBoardRoom *)boardRoom onPlaybackWhiteBoardStateChanged:(NSInteger)state errCode:(NSInteger)code;
objectivec

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

传入参数

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

byteWhiteBoardRoom:onPlaybackWhiteBoardProgressUpdate:duration:
- (void)byteWhiteBoardRoom:(ByteWhiteBoardRoom *)boardRoom onPlaybackWhiteBoardProgressUpdate:(NSInteger)progress duration:(NSInteger)duration;
objectivec

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

传入参数

参数名类型说明
progressNSInteger白板录像播放进度,单位 s
durationNSInteger总播放时长,单位 s

byteWhiteBoardRoom:onWhiteBoardCreated:elapsed:
- (void)byteWhiteBoardRoom:(ByteWhiteBoardRoom *)boardRoom onWhiteBoardCreated:(ByteWhiteBoard *)board elapsed:(NSInteger)elapsed;
objectivec

白板创建回调。进房后自动创建白板。

传入参数

参数名类型说明
boardByteWhiteBoardRoom*房间内的新白板对象
elapsedNSInteger从进房成功到该回调的时长。调用 updateByteWhiteBoardRoomDelegate: 更新回调手柄。
ByteWhiteBoardRoomManagerDelegate
@protocol ByteWhiteBoardRoomManagerDelegate <NSObject>
objectivec

ByteWhiteBoardRoomDelegate 回调

成员函数
返回名称
voidbyteWhiteBoardRoomManager:onOccurWarning:
voidbyteWhiteBoardRoomManager:onOccurError:
voidbyteWhiteBoardRoomManager:OnConnectionStateChanged:
voidbyteWhiteBoardRoomManager:onMediaSyncTimestamp:
函数说明

byteWhiteBoardRoomManager:onOccurWarning:
- (void)byteWhiteBoardRoomManager:(ByteWhiteBoardRoomManager *)boardRoomManager onOccurWarning:(ByteWhiteBoardWarningCode)code;
objectivec

当内部发生警告信息时回调该事件

传入参数

参数名类型说明
codeByteWhiteBoardWarningCode警告标识码,详见 ByteWhiteBoardWarningCode

byteWhiteBoardRoomManager:onOccurError:
- (void)byteWhiteBoardRoomManager:(ByteWhiteBoardRoomManager *)boardRoomManager onOccurError:(ByteWhiteBoardErrorCode)code;
objectivec

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

传入参数

参数名类型说明
codeByteWhiteBoardErrorCode错误标识码,详见 ByteWhiteBoardErrorCode

byteWhiteBoardRoomManager:OnConnectionStateChanged:
- (void)byteWhiteBoardRoomManager:(ByteWhiteBoardRoomManager *)boardRoomManager OnConnectionStateChanged:(ByteWhiteBoardConnectionState)state;
objectivec

回调 SDK 与信令服务器连接状态相关事件。当 SDK 与信令服务器的网络连接状态改变时回调该事件。

传入参数

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

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

byteWhiteBoardRoomManager:onMediaSyncTimestamp:
- (void)byteWhiteBoardRoomManager:(ByteWhiteBoardRoomManager *)boardRoomManager onMediaSyncTimestamp:(int64_t)timestamp;
objectivec

媒体时间戳回调

传入参数

参数名类型说明
timestampint64_t时间戳

注意
调用 enableMediaTimeSync: 开启后,将触发 2 秒一次周期性回调,返回时间戳,将时间戳作为 SEI 添加到视频帧中传递给其他用户实现 RTC 音视频互动和白板同步。