| 类名 | 类描述 |
|---|---|
| VHallChat | 播放器文档的使用 |
| 属性 | 属性描述 |
|---|---|
| delegate | 代理 |
| isSpeakBlocked | 是否被禁言(YES:自己被禁言或全体被禁言,NO:自己未被禁言且全体未被禁言) |
| isAllSpeakBlocked | 是否全体被禁言 |
| 方法 | 方法描述 |
|---|---|
| sendMsg | 发送聊天内容 |
| sendCustomMsg | 发送自定义消息 |
| getInteractsChatGetListWithMsg_id | 获取当前房间聊天列表 |
| 方法 | 方法描述 |
|---|---|
| reciveOnlineMsg | 收到上下线消息 |
| reciveChatMsg | 收到聊天消息 |
| reciveCustomMsg | 收到自定义消息 |
| deleteChatMsgId | 删除消息 |
| forbidChat | 收到自己被禁言/取消禁言 |
| allForbidChat | 收到全体禁言/取消全体禁言 |
| vhBaseNumUpdateToUpdate_online_num | 收到虚拟人数消息 |
| 参数名称 | 备注 |
|---|---|
| context | 附加消息 |
| data | 源数据 |
| eventType | 自定义消息通道事件 |
| privateMsg | YES=私聊(含 target_id),NO=非私聊 |
| role_name | 用户类型 1:主持人 2:观众 3:助理 4:嘉宾 |
| pv | 频道在线连接数 |
| uv | 频道在线用户数 |
| bu | 频道业务单元 |
| target_id | 消息接收方 id |
| join_id | 加入用户的 id |
| account_id | 用户 ID |
| user_name | 参会时的昵称 |
| nick_name | 参会时的昵称 |
| avatar | 头像 url,如果没有则为空字符串 |
| room | 房间号,即活动 id |
| time | 发送时间,根据服务器时间确定 |
| client | 消息来源 |
| msg_id | 消息 id |
| edit_role_type | 编辑的角色修改的角色 1,2,3,4 |
| edit_role_name | 角色名称 |
| role | 用户类型 host:主持人 guest:嘉宾 assistant:助理 user:观众 |
- (void)sendMsg:(NSString *)msg
success:(void(^)(void))success
failed:(void (^)(NSDictionary* failedData))reslutFailedCallback;| 参数名称 | 是否必须 | 示例 | 备注 |
|---|---|---|---|
| msg | 是 | 123 | 消息内容 |
[self.vhallChat sendMsg:messageText success:^{
} failed:^(NSDictionary *failedData) {
}];- (void)sendCustomMsg:(NSString *)jsonStr
success:(void(^)(void))success
failed:(void (^)(NSDictionary* failedData))reslutFailedCallback;| 参数名称 | 是否必须 | 示例 | 备注 |
|---|---|---|---|
| jsonStr | 是 | @"@{@"key":@"value"}" | 消息内容 |
[self.vhallChat sendCustomMsg:jsonStr success:^{
} failed:^(NSDictionary *failedData) {
}];- (void)getInteractsChatGetListWithMsg_id:(NSString *)msg_id
page_num:(NSInteger)page_num
page_size:(NSInteger)page_size
start_time:(NSString *)start_time
is_role:(NSInteger)is_role
anchor_path:(NSString *)anchor_path
success:(void(^)(NSArray <VHallChatModel *> * msgs))success
failed:(void (^)(NSDictionary* failedData))reslutFailedCallback;| 参数名称 | 是否必须 | 示例 | 备注 |
|---|---|---|---|
| msg_id | 是 | 123456 | 聊天记录 锚点消息 id,此参数存在时 anchor_path 参数必须存在 |
| page_num | 是 | 1 | 当前页码数,第一页从 1 开始 |
| page_size | 是 | 10 | 获取条目数量 |
| start_time | 否 | 间至今的所有聊天记录,若不指定时间可传 nil。格式如:@"2020-01-01 12:00:00" | |
| is_role | 否 | 0:不筛选主办方 1:筛选主办方 默认是 0 | |
| anchor_path | 否 | 锚点方向,up 向上查找,down 向下查找,此参数存在时 msg_id 参数必须存在,默认 down |
[self.vhallChat getInteractsChatGetListWithMsg_id:@"" page_num:1 page_size:10 start_time:nil is_role:0 anchor_path:nil success:^(NSArray<VHallChatModel *> *msgs) {
} failed:^(NSDictionary *failedData) {
}];- (void)reciveOnlineMsg:(NSArray <VHallOnlineStateModel *> *)msgs;| 参数名称 | 备注 |
|---|---|
| is_gag | 是否禁言 |
| device_status | 设备状态 |
| device_type | 设备类型 |
| event | online:上线消息 offline:下线消息 |
| concurrent_user | 房间内当前用户数 uv |
| attend_count | 参会人数 pv |
| tracksNum | PV |
- (void)reciveChatMsg:(NSArray <VHallChatModel *> *)msgs;| 参数名称 | 备注 |
|---|---|
| replyMsg | 回复消息,若无回复消息返回 nil |
| type | 聊天消息类型 |
| atList | @用户列表,若无@用户返回 nil |
| imageUrls | 图片消息 url 列表 |
| text | 聊天消息 |
- (void)reciveCustomMsg:(NSArray <VHallCustomMsgModel *> *)msgs;- (void)deleteChatMsgId:(NSString *)msgId;| 参数名称 | 备注 |
|---|---|
| jsonstr | 自定义消息,如果没有则为空字符串 |
- (void)forbidChat:(BOOL)forbidChat;| 参数名称 | 备注 |
|---|---|
| forbidChat | YES:禁言 NO:取消禁言 |
- (void)allForbidChat:(BOOL)allForbidChat;| 参数名称 | 备注 |
|---|---|
| allForbidChat | YES:禁言 NO:取消禁言 |
- (void)vhBaseNumUpdateToUpdate_online_num:(NSInteger)update_online_num
update_pv:(NSInteger)update_pv;| 参数名称 | 备注 |
|---|---|
| update_online_num | 增加的虚拟在线人数 |
| update_pv | 增加的虚拟热度 |