ByteWhiteBoardDelegate

@protocol ByteWhiteBoardDelegate <NSObject>

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

成员函数

返回 名称
void byteWhiteBoard:onOccurWarning:
void byteWhiteBoard:onOccurError:
void byteWhiteBoard:onInitBoard:currentPageID:boardStatus:
void byteWhiteBoard:onLockBoard:reason:
void byteWhiteBoard:onCanUndoStateChanged:
void byteWhiteBoard:onCanRedoStateChanged:
void byteWhiteBoardAttachedToWindow:
void byteWhiteBoardDetachedToWindow:
void byteWhiteBoardClearPage:
void byteWhiteBoard:onPageIndexChanged:pageInfo:
void byteWhiteBoard:onCreatePages:pageInfos:
void byteWhiteBoard:onRemovePages:
void byteWhiteBoard:onPagesCountChanged:
void byteWhiteBoard:OnChangePageBackground:backgroundInfo:
void byteWhiteBoard:OnChangeBoardBackground:

函数说明

byteWhiteBoard:onOccurWarning:

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

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

传入参数

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

byteWhiteBoard:onOccurError:

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

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

传入参数

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

byteWhiteBoard:onInitBoard:currentPageID:boardStatus:

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

画板初始化

传入参数

参数名 类型 说明
pages NSArray* 所有画板页信息
pageID NSString* 当前页
status ByteWhiteBoardBoardStatus 画板状态,详见 ByteWhiteBoardBoardStatus

byteWhiteBoard:onLockBoard:reason:

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

锁定画板 UI

传入参数

参数名 类型 说明
isLock BOOL 是否锁住
reason ByteWhiteBoardLockBoardReason 锁住原因,详见 ByteWhiteBoardLockBoardReason

byteWhiteBoard:onCanUndoStateChanged:

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

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

传入参数

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

byteWhiteBoard:onCanRedoStateChanged:

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

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

传入参数

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

byteWhiteBoardAttachedToWindow:

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

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

传入参数

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

byteWhiteBoardDetachedToWindow:

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

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

传入参数

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

byteWhiteBoardClearPage:

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

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

传入参数

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

byteWhiteBoard:onPageIndexChanged:pageInfo:

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

翻页回调

传入参数

参数名 类型 说明
current_index int 当前页
pageInfo ByteWhiteBoardPageInfo* 当前页信息

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

byteWhiteBoard:onCreatePages:pageInfos:

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

已创建一个新页面回调

传入参数

参数名 类型 说明
prePageID NSString* 刚创建的白板页面 ID
pageInfos NSArray* 刚创建的白板页面信息

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

byteWhiteBoard:onRemovePages:

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

删除页

传入参数

参数名 类型 说明
pageIDs NSArray* 被删除页面 ID

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

byteWhiteBoard:onPagesCountChanged:

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

总页数发生改变时通知(添加或删除),以便更新 UI

传入参数

参数名 类型 说明
totalCount NSInteger 新的总页数

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

byteWhiteBoard:OnChangePageBackground:backgroundInfo:

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

修改页背景信息

传入参数

参数名 类型 说明
pageID NSString* 被修改页的ID
bk_info ByteWhiteBoardBackgroundInfo* 背景信息

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

byteWhiteBoard:OnChangeBoardBackground:

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

修改默认背景

传入参数

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

注意

ByteWhiteBoardRoomDelegate

@protocol ByteWhiteBoardRoomDelegate <NSObject>

回调

成员函数

返回 名称
void byteWhiteBoardRoom:onOccurWarning:
void byteWhiteBoardRoom:onOccurError:
void byteWhiteBoardRoom:onJoinRoomResult:userID:errCode:isRejoin:
void byteWhiteBoardRoom:onLeaveRoomResult:reason:
void byteWhiteBoardRoom:onUserCountChanged:
void byteWhiteBoardRoom:onPlaybackWhiteBoardStateChanged:errCode:
void byteWhiteBoardRoom:onPlaybackWhiteBoardProgressUpdate:duration:
void byteWhiteBoardRoom:onWhiteBoardCreated:elapsed:

函数说明

byteWhiteBoardRoom:onOccurWarning:

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

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

传入参数

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

byteWhiteBoardRoom:onOccurError:

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

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

传入参数

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

byteWhiteBoardRoom:onJoinRoomResult:userID:errCode:isRejoin:

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

进房结果回调

传入参数

参数名 类型 说明
roomID NSString* 房间ID
userID NSString* 用户ID
code NSInteger 进房的错误码
rej BOOL false:第一次进房;true: 断网重连加入

byteWhiteBoardRoom:onLeaveRoomResult:reason:

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

离房结果回调

传入参数

参数名 类型 说明
roomID NSString* 房间ID
reason NSInteger 离房错误码

byteWhiteBoardRoom:onUserCountChanged:

- (void)byteWhiteBoardRoom:(ByteWhiteBoardRoom *)boardRoom onUserCountChanged:(NSInteger)count;

房间内用户人数回调 远端调用 joinRoom 进房或 leaveRoom 退房后,触发本回调。

传入参数

参数名 类型 说明
count NSInteger 房间人数

byteWhiteBoardRoom:onPlaybackWhiteBoardStateChanged:errCode:

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

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

传入参数

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

byteWhiteBoardRoom:onPlaybackWhiteBoardProgressUpdate:duration:

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

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

传入参数

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

byteWhiteBoardRoom:onWhiteBoardCreated:elapsed:

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

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

传入参数

参数名 类型 说明
board ByteWhiteBoardRoom* 房间内的新白板对象
elapsed NSInteger 从进房成功到该回调的时长

ByteWhiteBoardRoomManagerDelegate

@protocol ByteWhiteBoardRoomManagerDelegate <NSObject>

ByteWhiteBoardRoomDelegate 回调

成员函数

返回 名称
void byteWhiteBoardRoomManager:onOccurWarning:
void byteWhiteBoardRoomManager:onOccurError:
void byteWhiteBoardRoomManager:onMediaSyncTimestamp:

函数说明

byteWhiteBoardRoomManager:onOccurWarning:

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

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

传入参数

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

byteWhiteBoardRoomManager:onOccurError:

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

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

传入参数

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

byteWhiteBoardRoomManager:onMediaSyncTimestamp:

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

媒体时间戳回调 调用 enableMediaTimeSync: 开启后,将触发 2 秒一次周期性回调,返回时间戳,将时间戳传递给被动同步的对象实现同步播放

传入参数

参数名 类型 说明
timestamp int64_t 时间戳