PLVLiveVideoAPI

Objective-C

@interface PLVLiveVideoAPI : NSObject

/**
 设置私有的聊天室域名
 
 @param domainName 外部设置的私有域名,如果为空或没有设置,怎使用默认的域名
 */
 + (void)setPrivateApichatDomainName:(NSString *)domainName;

#pragma mark - 登录校验

/**
 登录校验
 两种校验类型:1.直播相关参数校验 2.回放相关参数校验(vid为nil时进行直播相关参数校验,非空时进行回放相关参数校验)
 1.直播相关参数校验:channelId、appId、userId、appSecret
 2.回放相关参数校验:①vid、appId、channelId、userId;②vid、appId(channelId为0时,版本兼容)
 v1.0.0 版本之后请使用新接口 '+verifyLivePermissionWithChannelId:userId:appId:appSecret:completion:failure:' 和 '+verifyVodPermissionWithVid:userId:appId:appSecret:completion:failure:' 进行直播和回放的登录校验
 @param channelId 直播频道号
 @param vid 回放点播视频vid
 @param appId 云直播账号 应用Id
 @param userId 云直播账号 用户Id
 @param appSecret 云直播账号 应用密钥
 */
+ (void)verifyPermissionWithChannelId:(NSUInteger)channelId vid:(NSString *)vid appId:(NSString *)appId userId:(NSString *)userId appSecret:(NSString *)appSecret completion:(void (^)(NSDictionary *))completion failure:(void (^)(NSError *))failure DEPRECATED_MSG_ATTRIBUTE("已废弃,请使用verifyPermissionWithChannelId:vid:appId:userId:completion:failure:");
/**
 登录校验
 两种校验类型:1.直播相关参数校验 2.回放相关参数校验(vid为nil时进行直播相关参数校验,非空时进行回放相关参数校验)
 1.直播相关参数校验:channelId、appId、userId
 2.回放相关参数校验:①vid、appId、channelId、userId;②vid、appId(channelId为0时,版本兼容)
 v1.0.0 版本之后请使用新接口 '+verifyLivePermissionWithChannelId:userId:appId:appSecret:completion:failure:' 和 '+verifyVodPermissionWithVid:userId:appId:appSecret:completion:failure:' 进行直播和回放的登录校验
 @param channelId 直播频道号
 @param vid 回放点播视频vid
 @param appId 云直播账号 应用Id
 @param userId 云直播账号 用户Id
 */
+ (void)verifyPermissionWithChannelId:(NSUInteger)channelId vid:(NSString *)vid appId:(NSString *)appId userId:(NSString *)userId completion:(void (^)(NSDictionary *))completion failure:(void (^)(NSError *))failure;

/**
 直播登录校验 API(v1.0.0版本+)
 直播相关参数校验:channelId、userId、appId、appSecret
 @param channelId 频道号
 @param userId 用户Id
 @param appId 应用Id
 @param appSecret 应用密钥
 */
+ (void)verifyLivePermissionWithChannelId:(NSUInteger)channelId
                                   userId:(NSString *)userId
                                    appId:(NSString *)appId
                                appSecret:(NSString *)appSecret
                               completion:(void (^)(NSDictionary *data))completion
                                  failure:(void (^)(NSError *error))failure DEPRECATED_MSG_ATTRIBUTE("已废弃,请使用verifyLivePermissionWithChannelId:userId:appId:completion:failure:");

/**
 直播登录校验 API(v1.0.0版本+)
 直播相关参数校验:channelId、userId、appId
 @param channelId 频道号
 @param userId 用户Id
 @param appId 应用Id */
+ (void)verifyLivePermissionWithChannelId:(NSUInteger)channelId
                                   userId:(NSString *)userId
                                    appId:(NSString *)appId
                               completion:(void (^)(NSDictionary *data))completion
                                  failure:(void (^)(NSError *error))failure;

/**
 回放登录校验 API(v1.0.0版本+)
 回放相关参数校验:channelId、vid、userId、appId、appSecret
 @param channelId 频道号
 @param vid 回放点播视频vid
 @param userId 用户Id
 @param appId 应用Id
 @param appSecret 应用密钥
 */
+ (void)verifyVodPermissionWithChannelId:(NSUInteger)channelId
                                     vid:(NSString *)vid
                                  userId:(NSString *)userId
                                   appId:(NSString *)appId
                               appSecret:(NSString *)appSecret
                              completion:(void (^)(NSDictionary *data))completion
                                 failure:(void (^)(NSError *error))failure DEPRECATED_MSG_ATTRIBUTE("已废弃,请使用verifyVodPermissionWithChannelId:vid:userId:appId:completion:failure:");

/**
 回放登录校验 API(v1.0.0版本+)
 回放相关参数校验:channelId、vid、userId、appId
 @param vid 回放点播视频vid
 @param userId 用户Id
 @param appId 应用Id
 */
+ (void)verifyVodPermissionWithChannelId:(NSUInteger)channelId
                                     vid:(NSString *)vid
                                  userId:(NSString *)userId
                                   appId:(NSString *)appId
                              completion:(void (^)(NSDictionary *data))completion
                                 failure:(void (^)(NSError *error))failure;

/// 推流登录,获取推流的频道信息
/// @param channelId 频道号
/// @param password 频道密码
/// @param channelType 频道类型,目前只支持(‘ppt’-三分屏/‘alone’-纯视频)两种频道类型
/// @param completion 成功回调
/// @param failure 失败回调
+ (void)loadPushInfoWithChannelId:(NSString *)channelId
                         password:(NSString *)password
                      channelType:(PLVChannelType)channelType
                       completion:(void (^)(NSDictionary *data, NSString *rtmpUrl))completion
                          failure:(void (^)(NSError *error))failure;

#pragma mark - 获取频道类型 & 直播状态

/**
 校验后,根据channelId获取该频道的类型(普通直播,云课堂),和是否正在直播(废弃从0.13.1)
 @param channelId 频道号
 */
+ (void)liveStatus:(NSString *)channelId completion:(void (^)(BOOL, NSString *))completion failure:(void (^)(NSError *error))failure;

/// 获取频道的直播类型、直播流状态(v2)
///
/// @param channelId 频道号ID
/// @param completion 请求完成Block (channelType:频道类型 streamState:当前直播流状态)
/// @param failure 请求失败Block
+ (void)liveStatus2:(NSString *)channelId completion:(void (^)(PLVChannelType channelType, PLVChannelLiveStreamState streamState))completion failure:(void (^)(NSError *error))failure;

/// 获取频道的直播类型、直播流状态(v3)
///
/// @param channelId 频道号ID
/// @param appId 云直播账号 应用Id
/// @param appSecret 云直播账号 应用密钥
/// @param completion 请求完成Block (channelType:频道类型 streamState:当前直播流状态)
/// @param failure 请求失败Block
+ (void)liveStatus2:(NSString *)channelId appId:(NSString *)appId appSecret:(NSString *)appSecret completion:(void (^)(PLVChannelType channelType, PLVChannelLiveStreamState streamState))completion failure:(void (^)(NSError *error))failure;

/**
 登录界面,校验后,根据vodId获取该频道的类型(普通直播,云课堂)
 
 @param vodId 回放视频ID
 */
+ (void)getVodType:(NSString *)vodId completion:(void (^)(PLVChannelType channelType))completion failure:(void (^)(NSError *error))failure;

/**
 登录界面,校验后,根据文件Id获取该频道的类型(普通直播,云课堂)
 
 @param channelId 直播频道号
 @param fileId 文件Id
 @param appId 云直播账号 应用Id
 @param appSecret 云直播账号 应用密钥
 */
+ (void)getLiveRecordTypeWithChannelId:(NSString *)channelId fileId:(NSString *)fileId appId:(NSString *)appId appSecret:(NSString *)appSecret completion:(void (^)(PLVChannelType))completion failure:(void (^)(NSError *error))failure;

/**
 获取频道菜单列表
 
 @param channelId 频道号
 */
+ (void)getChannelMenuInfos:(NSString *)channelId completion:(void(^)(PLVLiveVideoChannelMenuInfo *channelMenuInfo))completion failure:(void (^)(NSError *error))failure;

/**
 修改频道名
 
 @param channelName 频道名称
 @param channelId 频道号
 */
+ (void)updateChannelName:(NSString *)channelName channelId:(NSString *)channelId completion:(void (^)(void))completion failure:(void (^)(NSError *error))failure;


#pragma mark - 文档

/**
  根据频道号 channelId 获取 文档列表数据
 @note 用于 手机开播(三分屏)场景
 @param channelId 频道号
 */
+ (void)requestDocumentListWithChannelId:(NSString *)channelId completion:(void (^)(NSArray<NSDictionary *> *responseArray))completion failure:(void (^)(NSError *error))failure;

/// 获取文档列表数据
/// @note 用于 互动学堂 场景
/// @param lessonId 课节ID
/// @param completion 成功回调
/// @param failure 失败回调
+ (void)requestDocumentListWithLessonId:(NSString *)lessonId completion:(void (^)(NSArray<NSDictionary *> *responseArray))completion failure:(void (^)(NSError *error))failure DEPRECATED_MSG_ATTRIBUTE("Please use 'requestDocumentListWithLessonId:courseCode:teacher:completion:failure:' instead");

/// 获取文档列表数据
/// @note 用于 互动学堂 场景
/// @param lessonId 课节ID
/// @param courseCode 课程号
/// @param teacher 是否为讲师
/// @param completion 成功回调
/// @param failure 失败回调
+ (void)requestDocumentListWithLessonId:(NSString *)lessonId
                             courseCode:(NSString * _Nullable)courseCode teacher:(BOOL)teacher
                             completion:(void (^)(NSArray<NSDictionary *> *responseArray))completion
                                failure:(void (^)(NSError *error))failure;

/**
  根据频道号 channelId、文件ID fileId 删除某个文档
 
 @param channelId 频道号
 @param fileId 文件ID
 */
+ (void)deleteDocumentWithChannelId:(NSString * _Nullable)channelId fileId:(NSString *)fileId completion:(void (^)(void))completion failure:(void (^)(NSError *error))failure;

/**
  获取 PPT 文档转码结果
 @note 用于 手机开播(三分屏)场景
 @param channelId 频道号
 @param fileId 文件ID
 */ 
+ (void)getDocumentConvertStatusWithChannelId:(NSString *)channelId fileId:(NSString *)fileId completion:(void (^)(NSArray <NSDictionary *> *responseArray))completion failure:(void (^)(NSError *error))failure;

/// 获取 PPT 文档转码结果
/// @note 用于 互动学堂 场景
/// @param lessonId 课程号
/// @param fileId 文件ID
/// @param completion 成功回调
/// @param failure 失败回调
+ (void)getDocumentConvertStatusWithLessonId:(NSString *)lessonId fileId:(NSString *)fileId completion:(void (^)(NSArray <NSDictionary *> *responseArray))completion failure:(void (^)(NSError *error))failure DEPRECATED_MSG_ATTRIBUTE("Please use 'getDocumentConvertStatusWithLessonId:fileId:courseCode:teacher:completion:failure:' instead");

/// 获取 PPT 文档转码结果
/// @note 用于 互动学堂 场景
/// @param lessonId 课程号
/// @param fileId 文件ID
/// @param courseCode 课程号
/// @param teacher 是否为讲师
/// @param completion 成功回调
/// @param failure 失败回调
+ (void)getDocumentConvertStatusWithLessonId:(NSString *)lessonId
                                      fileId:(NSString *)fileId
                                  courseCode:(NSString * _Nullable)courseCode
                                     teacher:(BOOL)teacher
                                  completion:(void (^)(NSArray <NSDictionary *> *responseArray))completion failure:(void (^)(NSError *error))failure;

#pragma mark - 聊天室相关

/**
 获取 chatToken

 @param channelId 频道号
 @param userId 聊天室用户ID
 @param role 聊天室用户角色
 @Param groupId 聊天室分组Id
 */
+ (void)getChatTokenWithChannelId:(NSString *)channelId
                           userId:(NSString *)userId
                             role:(NSString *)role
                          groupId:(NSString * _Nullable)groupId
                       completion:(void (^)(NSDictionary *))completion
                          failure:(void (^)(NSError *error))failure;

/**
 获取 chatToken,分组Id默认为空

 @param channelId 频道号
 @param userId 聊天室用户ID
 @param role 聊天室用户角色
 */
+ (void)getChatTokenWithChannelId:(NSString *)channelId
                           userId:(NSString *)userId
                             role:(NSString *)role
                       completion:(void (^)(NSDictionary *))completion
                          failure:(void (^)(NSError *error))failure;

/**
 获取 chatToken,身份默认为 viewer

 @param channelId 频道号
 @param userId 聊天室用户ID
 */
+ (void)getChatTokenWithChannelId:(NSString *)channelId userId:(NSString *)userId completion:(void (^)(NSDictionary *data))completion failure:(void (^)(NSError *error))failure;

/**
 加载聊天室开关信息
 
 @param roomId 频道号
 */
+ (void)loadChatroomFunctionSwitchWithRoomId:(NSUInteger)roomId completion:(void (^)(NSDictionary *switchInfo))completion failure:(void (^ _Nullable)(NSError *error))failure;

/**
 根据时间戳加载聊天室历史记录
 
 @param roomId 频道号
 @param index 如果目前展示的消息已经有time为timestamp,且有1条,index不用传或者传1。假如有两条,则index传2,三条传3,依此类推。
 @param size 每页长度
 @param timestamp 从该时间戳开始获取,不传表示获取最新的数据
 @param order 数据根据时间戳的顺序,YES表示从小到大,NO表示从大到小
 */
+ (void)requestChatRoomHistoryWithRoomId:(NSString *)roomId index:(NSUInteger)index size:(NSInteger)size timestamp:(NSString *)timestamp order:(BOOL)order completion:(void (^)(NSArray * _Nonnull))completion failure:(void (^)(NSError * _Nonnull))failure;

/**
 加载聊天室历史记录
 
 @param roomId 频道号
 @param startIndex 开始index
 @param endIndex 结束index
 */
+ (void)requestChatRoomHistoryWithRoomId:(NSString *)roomId startIndex:(NSUInteger)startIndex endIndex:(NSInteger)endIndex completion:(void (^)(NSArray *historyList))completion failure:(void (^)(NSError *error))failure;

/**
 获取聊天室在线人数列表接口 1
 
 @param roomId 频道号/房间号
 @param page 页码
 @param length 一页的数据条数
 @param streamer YES-当前用户为讲师和特殊身份,返回classStatus字段(非讲师身份不可为YES,会有性能问题)
 */
+ (void)requestChatRoomListUsersWithRoomId:(NSString *)roomId
                                      page:(NSUInteger)page
                                    length:(NSUInteger)length
                                  streamer:(BOOL)streamer
                                   success:(void (^)(NSDictionary *data))success
                                   failure:(void (^ _Nullable)(NSError *error))failure;

/**
 获取聊天室在线人数列表接口 2
 
 @param roomId 频道号/房间号
 @param page 页码
 @param length 一页的数据条数
 @param sessionId 场次ID,目前该参数只用于互动学堂场景
 @param streamer YES-当前用户为讲师和特殊身份,返回classStatus字段(非讲师身份不可为YES,会有性能问题) 
 */
+ (void)requestChatRoomListUsersWithRoomId:(NSString *)roomId
                                      page:(NSUInteger)page
                                    length:(NSUInteger)length
                                 sessionId:(NSString * _Nullable)sessionId
                                  streamer:(BOOL)streamer
                                   success:(void (^)(NSDictionary *))success
                                   failure:(void (^ _Nullable)(NSError *))failure;

/**
 获取聊天室具体房间号被踢出的用户列表
 @param roomId 频道号/房间号
 */
+ (void)requestChatRoomListKickedWithRoomId:(NSString *)roomId
                                    success:(void (^)(NSArray *responseArray))success
                                    failure:(void (^)(NSError *error))failure;

/**
 获取图片表情列表接口
 
 @param roomId 频道号/房间号
 @param accountId 账号Id
 @param page 页码
 @param size 一页的数据条数
 */
+ (void)requestEmotionImagesWithRoomId:(NSUInteger)roomId
                             accountId:(NSString *)accountId
                                  page:(NSUInteger)page
                                  size:(NSUInteger)size
                               success:(void (^)(NSDictionary *data))success
                               failure:(void (^ _Nullable)(NSError *error))failure;

/**
 点赞
 
 @param channelId 频道号
 @param viewerId 聊天室用户Id
 @param times 某段时间内新增点赞数
 */
+ (void)likeWithChannelId:(NSUInteger)channelId viewerId:(NSString *)viewerId times:(NSUInteger)times completion:(void (^)(void))completion failure:(void (^ _Nullable )(NSError *error))failure;

/**
 发送图片
 
 @param image 图片
 @param imageName 图片名字
 @param channelId 频道号
 */
+ (void)uploadImage:(UIImage *)image
          imageName:(NSString *)imageName
          channelId:(NSString *)channelId
           progress:(void (^)(float))progressBlock
            success:(void (^)(NSDictionary *tokenDict, NSString *key, NSString *imageName))successBlock
               fail:(void (^)(NSError *error))failBlock;

/**
 发送图片
 @note 使用该方法上传的图片,会压缩到小于2MB为止
 @param image 图片
 @param imageName 图片名字
 */
+ (void)uploadImage:(UIImage *)image
          imageName:(NSString *)imageName
           progress:(void (^)(float))progressBlock
            success:(void (^)(NSDictionary *tokenDict, NSString *key, NSString *imageName))successBlock
               fail:(void (^)(NSError *error))failBlock DEPRECATED_MSG_ATTRIBUTE("已废弃,请使用uploadImage:imageName:channelId:progress:success:fail:");

/**
 发送图片
 @note 使用该方法上传的图片,不会再进行压缩
 @param imageData 图片数据
 @param imageName 图片名字
 @param channelId 频道号
 */
+ (void)uploadImageData:(NSData *)imageData
              imageName:(NSString *)imageName
              channelId:(NSString *)channelId
               progress:(void (^)(float))progressBlock
                success:(void (^)(NSDictionary *tokenDict, NSString *key, NSString *imageName))successBlock
                   fail:(void (^)(NSError *error))failBlock;

/**
 发送图片
 @note 使用该方法上传的图片,不会再进行压缩
 @param imageData 图片数据
 @param imageName 图片名字
 */
+ (void)uploadImageData:(NSData *)imageData
              imageName:(NSString *)imageName
               progress:(void (^)(float))progressBlock
                success:(void (^)(NSDictionary *tokenDict, NSString *key, NSString *imageName))successBlock
                   fail:(void (^)(NSError *error))failBlock DEPRECATED_MSG_ATTRIBUTE("已废弃,请使用uploadImageData:imageName:channelId:progress:success:fail:");

/**
 增加播放热度
 
 @param channelId 频道号
 @param times 新增 socket login 次数(收到自己的 login 消息一次 times +1)
 */
+ (void)increaseViewerWithChannelId:(NSString *)channelId times:(NSUInteger)times completion:(void (^)(NSInteger))completion failure:(void (^)(NSError *error))failure;

/// 获取当前观看次数
/// @param channelId 频道号
+ (void)requestPageViewWithChannelId:(NSString *)channelId completion:(void (^)(NSDictionary *data))completion failure:(void (^)(NSError *error))failure;

/// 加载聊天室提醒消息历史记录
/// @param roomId 频道号
/// @param startIndex 开始index
/// @param endIndex 结束index
/// @param completion 成功回调
/// @param failure 失败回调
+ (void)requestChatRoomRemindHistoryWithRoomId:(NSString *)roomId startIndex:(NSUInteger)startIndex endIndex:(NSInteger)endIndex completion:(void (^)(NSArray *historyList))completion failure:(void (^)(NSError *error))failure;

/// 获取最新红包
/// @param channelId 频道号
/// @param completion 成功回调
/// @param failure 失败回调
+ (void)requestNewestRedpackWithChannelId:(NSString *)channelId completion:(void (^)(NSDictionary *data))completion failure:(void (^_Nullable)(NSError *error))failure;

/// 判断观众是否已抢红包
/// @param channelId 频道号
/// @param viewerId 观众viewerId
/// @param redpackId 红包ID
/// @param redCacheId 红包CacheID
/// @param completion 成功回调
/// @param failure 失败回调
+ (void)requestRedpackReceiveCacheWithChannelId:(NSString *)channelId
                                       viewerId:(NSString *)viewerId
                                      redpackId:(NSString *)redpackId
                                     redCacheId:(NSString *)redCacheId
                                     completion:(void (^)(NSDictionary *data))completion
                                        failure:(void (^_Nullable)(NSError *error))failure;

/// 加载聊天室提问消息历史记录
/// @param roomId 频道号
/// @param page 页码
/// @param pageSize 每页的size
/// @param completion 成功回调
/// @param failure 失败回调
+ (void)requestChatRoomQuestionHistoryWithRoomId:(NSString *)roomId page:(NSUInteger)page pageSize:(NSInteger)pageSize completion:(void (^)(NSDictionary *data))completion failure:(void (^)(NSError * _Nonnull))failure;

#pragma mark - 连麦相关

/**
 普通直播,获取推流端是旧的推流端(主讲人走CDN视频,连麦走RTC音频),还是新的推流端(主讲人走RTC视频,连麦走RTC)
 
 @param channelId 频道号
 */
+ (void)rtcEnabled:(NSUInteger)channelId completion:(void (^)(BOOL))completion failure:(void (^)(NSError *))failure;

/**
 检测当前连麦状态
 
 @param roomId 频道号
 */
+ (void)requestLinkMicStatusWithRoomId:(NSUInteger)roomId completion:(void (^)(NSString *, NSString *))completion failure:(void (^)(NSError *))failure;

/**
 获取当前连麦列表
 
 @param roomId 频道号
 @param sessionId 当前直播的sessionId
 */
+ (void)requestLinkMicOnlineListWithRoomId:(NSString *)roomId sessionId:(NSString *)sessionId completion:(void (^)(NSDictionary *))completion failure:(void (^)(NSError *))failure;

/**
 获取当前连麦列表
 
 @param roomId 频道号
 @param sessionId 当前直播的sessionId
 @param getSubRooms 是否获取转播子频道信息,默认为NO
 */
+ (void)requestLinkMicOnlineListWithRoomId:(NSString *)roomId
                                 sessionId:(NSString *)sessionId
                               getSubRooms:(BOOL)getSubRooms
                                completion:(void (^)(NSDictionary *))completion
                                   failure:(void (^)(NSError *))failure;

/**
 连麦id和聊天室用户id关联
 
 @param channelId 频道号
 @param viewerId 聊天室的用户Id
 @param linkMicId 连麦id
 */
+ (void)requestViewerIdLinkMicIdRelate:(NSString *)channelId viewerId:(NSString *)viewerId linkMicId:(NSString *)linkMicId completion:(nullable void (^)(void))completion failure:(nullable void (^)(NSError *))failure;

/**
 强制下麦
 
 @param channelId 频道号
 @param userId 连麦用户ID
 @param linkMicId 连麦id
 */
+ (void)requestLinkMicRemoveUser:(NSString *)channelId userId:(NSString *)userId linkMicId:(NSString *)linkMicId completion:(void (^)(BOOL))completion failure:(void (^)(NSError *))failure;

#pragma mark - SIP相关
/**
 获取SIP入会信息
 @param channelId 频道号
 */
+ (void)requestSIPInfoWithChannelId:(NSString *)channelId completion:(void (^)(NSDictionary *data))completion failure:(void (^)(NSError * error))failure;

/**
 获取当前拨号情况列表
 @param channelId 频道号
 */
+ (void)requestSIPDialLinesListWithChannelId:(NSString *)channelId completion:(void (^)(NSDictionary *data))completion failure:(void (^)(NSError *error))failure;

#pragma mark - 抽奖

/**
 发送中奖信息(自 v0.11.1 失效)
 
 @param data 中奖信息
 */
+ (void)postLotteryWithData:(NSDictionary *)data completion:(void (^)(void))completion failure:(void (^)(NSError *error))failure;

/**
 发送中奖信息(自 v0.11.1 生效)
 
 @param data 中奖信息
 */
+ (void)newPostLotteryWithData:(NSDictionary *)data completion:(void (^)(void))completion failure:(void (^)(NSError *error))failure;

/**
 放弃领奖
 
 @param channelId 频道号
 @param userId 聊天室用户ID
 */
+ (void)giveUpReceiveWithChannelId:(NSString *)channelId userId:(NSString *)userId completion:(void (^)(NSString *))completion failure:(void (^)(NSError *error))failure;

#pragma mark - 礼物打赏

/**
  获取该频道打赏设置
  
  @param channelId 频道号
  */
+ (void)requestRewardWithChannelId:(NSString *)channelId completion:(void (^)(NSDictionary*))completion failure:(void (^)(NSError * _Nonnull))failure;

/**
  获取该频道积分打赏设置
  
  @param channelId 频道号
  */
 + (void)requestPointSettingWithChannelId:(NSUInteger)channelId completion:(nullable void (^)(NSDictionary *))completion failure:(nullable void (^)(NSError *))failure;

 /**
 获取观众的积分信息
  
 @param viewerId 聊天室用户Id
 @param nickName 观众的用户昵称
 @param channelId 频道号
 */
 + (void)requestViewerPointWithViewerId:(NSString *)viewerId nickName:(NSString *)nickName channelId:(NSUInteger)channelId completion:(nullable void (^)(NSString *))completion failure:(nullable void (^)(NSError *))failure;

 /**
 观众打赏积分道具
  
 @param viewerId 聊天室用户Id
 @param nickName 观众的昵称
 @param avatar 观众的头像地址
 @param goodId 商品id
 @param goodNum 商品数量
 @param channelId 频道号
 */
 + (void)requestViewerRewardPointWithViewerId:(NSString *)viewerId nickName:(NSString *)nickName avatar:(NSString *)avatar goodId:(NSInteger)goodId goodNum:(NSInteger)goodNum channelId:(NSUInteger)channelId completion:(nullable void (^)(NSString *))completion failure:(nullable void (^)(NSError *))failure;

/**
观众打赏免费道具
 
@param viewerId 聊天室用户Id
@param nickName 观众的昵称
@param avatar 观众的头像地址
@param goodId 商品id
@param goodNum 商品数量
@param channelId 频道号
@param sessionId 场次号
*/
+ (void)requestViewerFreeDonateRewardWithViewerId:(NSString *)viewerId nickName:(NSString *)nickName avatar:(NSString *)avatar goodId:(NSInteger)goodId goodNum:(NSInteger)goodNum channelId:(NSUInteger)channelId sessionId:(NSString *)sessionId completion:(nullable void (^)(void))completion failure:(nullable void (^)(NSError *))failure;

/// 获取卡片推送相关信息
/// @param channelId 频道id
/// @param cardPushId 商品推送id
+ (void)requestCardPushInfoWithChannelId:(NSString *)channelId cardPushId:(NSString *)cardPushId completion:(void (^)(NSDictionary *cardDict))completion failure:(nullable void (^)(NSError *))failure;

/// 查询频道打赏设置(新版后台)
/// @param channelId 频道号
///
+ (void)requestDonateWithChannelId:(NSString *)channelId completion:(void (^)(NSDictionary*))completion failure:(void (^)(NSError * _Nonnull))failure;

/// 修改频道礼物打赏开关
+ (void)updateDonateGiftWithChannelId:(NSString *)channelId donateGiftEnabled:(BOOL)donateGiftEnabled completion:(nullable void (^)(void))completion failure:(void (^)(NSError * _Nonnull))failure;

#pragma mark - 直播回放
/**
 获取视频弹幕信息
 */
+ (void)loadDanmuWithVid:(NSString *)vid time:(NSString *)time msgId:(NSUInteger)msgId limit:(NSUInteger)limit completion:(void (^)(NSArray *danmuArr, NSError *error))completion;

/**
 新增回放弹幕
 */
+ (void)addDanmuWithVid:(NSString *)vid msg:(NSString *)msg time:(NSString *)time sessionId:(NSString *)sessionId msgType:(NSString *)msgType user:(NSString *)user completion:(void (^)(NSDictionary *respondDict, NSError *error))completion;

/// 查询频道回放功能开关
/// @param channelId 频道号
/// @param appId 用户appId
/// @param appSecret 用户appSecret
/// @param completion 请求完成块
+ (void)requestPlaybackEnableWithChannelId:(NSString *)channelId appId:(NSString *)appId appSecret:(NSString *)appSecret completion:(void (^)(BOOL enable , NSError * _Nullable error))completion;

/// 查询回放视频的视频列表信息(区分是否是接收转播的频道)
/// @param channelId 频道号
/// @param listType playback-回放列表,vod-点播列表; 默认普通直播场景为vod,三分屏为playback
/// @param page 页数,默认每页显示12条数据
/// @param pageSize 每页显示的数据条数,0为默认值
/// @param appId 用户appId
/// @param appSecret 用户appSecret
/// @param completion 请求完成块
+ (void)requestPlaybackListWithChannelId:(NSString *)channelId listType:(NSString *)listType page:(NSUInteger)page pageSize:(NSUInteger)pageSize appId:(NSString *)appId appSecret:(NSString *)appSecret completion:(void (^)(PLVPlaybackListModel * _Nullable model, NSError * _Nullable error))completion;

/// 查询回放视频的视频列表信息
/// @param channelId 频道号
/// @param listType playback-回放列表,vod-点播列表; 默认普通直播场景为vod,三分屏为playback
/// @param page 页数,默认每页显示12条数据
/// @param pageSize 每页显示的数据条数,0为默认值
/// @param appId 用户appId
/// @param appSecret 用户appSecret
/// @param completion 请求完成块
+ (void)requestPlaybackList:(NSString *)channelId listType:(NSString *)listType page:(NSUInteger)page pageSize:(NSUInteger)pageSize appId:(NSString *)appId appSecret:(NSString *)appSecret completion:(void (^)(PLVPlaybackListModel * _Nullable model, NSError * _Nullable error))completion DEPRECATED_MSG_ATTRIBUTE("已废弃,请使用requestPlaybackListWithChannelId:listType:page:pageSize:appId:appSecret:completion:");

/// 查询章节功能开关
/// @param channelId 频道号
/// @param completion 请求完成块
+ (void)requestLivePlaybackSectionEnableWithChannelId:(NSString *)channelId completion:(void (^)(BOOL enable))completion failure:(void (^)( NSError * _Nullable error))failure DEPRECATED_MSG_ATTRIBUTE("已废弃,请使用requestChannelPlaybackSettingWithChannelId:appId:completion:failure:");

/// 获取回放章节列表 (v2)
/// @param channelId 频道号
/// @param videoId 直播系统生成的回放id
/// @param appId 用户appId
/// @param appSecret 用户appSecret
/// @param completion 请求完成块
+ (void)requestLivePlaybackSectionListWithChannelId:(NSString *)channelId videoId:(NSString *)videoId appId:(NSString *)appId appSecret:(NSString *)appSecret completion:(void (^)(NSArray<PLVLivePlaybackSectionModel *> *sectionList, NSError * _Nullable error))completion;

/// 获取回放章节列表
/// @param channelId 频道号
/// @param videoId 直播系统生成的回放id
/// @param completion 请求完成块
+ (void)requestLivePlaybackSectionListWithChannelId:(NSString *)channelId videoId:(NSString *)videoId completion:(void (^)(NSArray<PLVLivePlaybackSectionModel *> *sectionList, NSError * _Nullable error))completion;

/// 查询回放功能设置
/// @param channelId 频道号
/// @param appId 用户appId
/// @param vid 视频vid
/// @param playbackType 回放类型
/// @param completion 请求完成块,回放设置可为空
+ (void)requestChannelPlaybackInfoWithChannelId:(NSString *)channelId appId:(NSString *)appId appSecret:(NSString *)appSecret vid:(NSString * _Nullable)vid playbackType:(NSString * _Nullable)playbackType completion:(void (^)(PLVChannelPlaybackInfoModel * _Nullable channelPlaybackInfo))completion failure:(void (^)( NSError * _Nullable error))failure;

/// 查询回放功能设置
/// @param channelId 频道号
/// @param completion 请求完成块,回放设置可为空
+ (void)requestChannelPlaybackInfoWithChannelId:(NSString *)channelId completion:(void (^)(PLVChannelPlaybackInfoModel * _Nullable channelPlaybackInfo))completion failure:(void (^)( NSError * _Nullable error))failure DEPRECATED_MSG_ATTRIBUTE("已废弃,请使用requestChannelPlaybackSettingWithChannelId:appId:completion:failure:");

/// 获取录制文件章节列表 (v2)
/// @param channelId 频道号
/// @param fileId 录制文件id
/// @param appId 用户appId
/// @param appSecret 用户appSecret
/// @param completion 请求完成块
+ (void)requestLiveRecordSectionListWithChannelId:(NSString *)channelId fileId:(NSString *)fileId appId:(NSString *)appId appSecret:(NSString *)appSecret completion:(void (^)(NSArray<PLVLivePlaybackSectionModel *> *sectionList, NSError * _Nullable error))completion;

/// 获取录制文件章节列表
/// @param channelId 频道号
/// @param fileId 录制文件id
/// @param completion 请求完成块
+ (void)requestLiveRecordSectionListWithChannelId:(NSString *)channelId fileId:(NSString *)fileId completion:(void (^)(NSArray<PLVLivePlaybackSectionModel *> *sectionList, NSError * _Nullable error))completion;

/// 修改频道开关状态设置
/// @param channelId 频道号
/// @param playbackEnabled 回放开关状态
/// @param completion 请求完成块
+ (void)updatePlaybackSettingWithChannelId:(NSString *)channelId playbackEnabled:(BOOL)playbackEnabled  completion:(nullable void (^)(void))completion failure:(void (^)(NSError * _Nonnull))failure;

#pragma mark - 跑马灯

/**
 加载自定义跑马灯

 @param url 自定义跑马灯地址
 @param channelId 直播频道号
 @param userId 云直播账号 用户ID
 @param code 自定义跑马灯附带参数
 @param completion 加载成功
 @param failure 加载失败
 */
+ (void)loadCustomMarquee:(NSURL *)url withChannelId:(NSUInteger)channelId userId:(NSString *)userId code:(NSString *)code completion:(void (^)(BOOL valid, NSDictionary *marqueeDict))completion failure:(void (^)(NSError *error))failure;

#pragma mark - 商品

/**
 获取商品列表
 
 @param channelId 频道号
 @param rank 排序号 (加载序号以前的商品)
 @param count 获取列表数据大小,默认10条,最大20
 @param completion 加载成功(返回商品列表顺序与后台显示顺序一致)
 @param failure 加载失败
 */
+ (void)loadCommodityList:(NSUInteger)channelId rank:(NSUInteger)rank count:(NSUInteger)count completion:(void (^)(NSUInteger total, NSArray<PLVCommodityModel *> *commoditys))completion failure:(void (^)(NSError *error))failure;

#pragma mark - 海报

/// 获取邀请海报设置
/// @param channelId 频道号
/// @param success 请求成功
/// @param failure 请求失败
+ (void)requestInvitePosterWithChannelId:(NSString *)channelId success:(void (^) (NSDictionary *respondDict))success failure:(void (^)(NSError * error))failure;

#pragma mark - 推流
/// 更新频道直播状态至结束接口
///
/// @param channelId 频道号
/// @param stream 流名
/// @param success 请求成功
/// @param failure 请求失败
+ (void)requestChannelLivestatusEndWithChannelId:(NSString *)channelId stream:(NSString *)stream success:(void (^)(NSString *))success failure:(void (^)(NSError * error))failure;

#pragma mark - 分组

/// 获取分组列表
/// @param channelId 频道号
/// @param appId appId
/// @param channelToken api频道token
/// @param success 请求成功
/// @param failure 请求失败
+ (void)requestGroupListWithChannelId:(NSString *)channelId
                                appId:(NSString *)appId
                         channelToken:(NSString *)channelToken
                              success:(void (^)(NSArray<NSDictionary *> *groupArray))success
                              failure:(void (^ _Nullable)(NSError * error))failure;

#pragma mark 观看页用户列表
/// 获取观看页用户列表
/// @param roomId 频道号
/// @param success 请求成功
/// @param failure 请求失
+ (void)requestViewerListWithRoomId:(NSString *)roomId
                            success:(void (^)(NSDictionary *viewerListDict))success
                            failure:(void (^ _Nullable)(NSError * error))failure;
/// 获取观看页分组用户列表
/// @param roomId 频道号
/// @param groupId 分组
/// @param success 请求成功
/// @param failure 请求失
+ (void)requestViewerListWithRoomId:(NSString *)roomId
                            groupId:(NSString *)groupId
                            success:(void (^)(NSDictionary *viewerListDict))success
                            failure:(void (^ _Nullable)(NSError * error))failure;

#pragma mark 多会场

+ (void)requestMultiMeetingListWithChannelId:(NSString *)channelId
                               mainChannelId:(NSString *)mainChannelId
                                  pageNumber:(NSUInteger)pageNumber
                                    pageSize:(NSUInteger)pageSize
                                     success:(void (^) (NSDictionary *multiMeetingList))success
                                     failure:(void (^ _Nullable)(NSError * error))failure;

+ (void)requestMultiMeetingLiveStatusWithMainChannelId:(NSString *)mainChannelId 
                                               success:(void (^) (NSArray *multiMeetingLiveStatusList))success
                                               failure:(void (^ _Nullable)(NSError * error))failure;

@end

Swift

class PLVLiveVideoAPI : NSObject

Undocumented

  • 设置私有的聊天室域名

    Declaration

    Objective-C

    + (void)setPrivateApichatDomainName:(nonnull NSString *)domainName;

    Swift

    class func setPrivateApichatDomainName(_ domainName: String)

    Parameters

    domainName

    外部设置的私有域名,如果为空或没有设置,怎使用默认的域名

登录校验

  • Deprecated

    已废弃,请使用verifyPermissionWithChannelId:vid:appId:userId:completion:failure:

    登录校验 两种校验类型:1.直播相关参数校验 2.回放相关参数校验(vid为nil时进行直播相关参数校验,非空时进行回放相关参数校验) 1.直播相关参数校验:channelId、appId、userId、appSecret 2.回放相关参数校验:①vid、appId、channelId、userId;②vid、appId(channelId为0时,版本兼容) v1.0.0 版本之后请使用新接口 ‘+verifyLivePermissionWithChannelId:userId:appId:appSecret:completion:failure:’ 和 ‘+verifyVodPermissionWithVid:userId:appId:appSecret:completion:failure:’ 进行直播和回放的登录校验

    Declaration

    Objective-C

    + (void)verifyPermissionWithChannelId:(NSUInteger)channelId
                                      vid:(nonnull NSString *)vid
                                    appId:(nonnull NSString *)appId
                                   userId:(nonnull NSString *)userId
                                appSecret:(nonnull NSString *)appSecret
                               completion:(nonnull void (^)(NSDictionary *_Nonnull))
                                              completion
                                  failure:
                                      (nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func verifyPermission(withChannelId channelId: UInt, vid: String, appId: String, userId: String, appSecret: String, completion: @escaping ([AnyHashable : Any]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    直播频道号

    vid

    回放点播视频vid

    appId

    云直播账号 应用Id

    userId

    云直播账号 用户Id

    appSecret

    云直播账号 应用密钥

  • 登录校验 两种校验类型:1.直播相关参数校验 2.回放相关参数校验(vid为nil时进行直播相关参数校验,非空时进行回放相关参数校验) 1.直播相关参数校验:channelId、appId、userId 2.回放相关参数校验:①vid、appId、channelId、userId;②vid、appId(channelId为0时,版本兼容) v1.0.0 版本之后请使用新接口 ‘+verifyLivePermissionWithChannelId:userId:appId:appSecret:completion:failure:’ 和 ‘+verifyVodPermissionWithVid:userId:appId:appSecret:completion:failure:’ 进行直播和回放的登录校验

    Declaration

    Objective-C

    + (void)verifyPermissionWithChannelId:(NSUInteger)channelId
                                      vid:(nonnull NSString *)vid
                                    appId:(nonnull NSString *)appId
                                   userId:(nonnull NSString *)userId
                               completion:(nonnull void (^)(NSDictionary *_Nonnull))
                                              completion
                                  failure:
                                      (nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func verifyPermission(withChannelId channelId: UInt, vid: String, appId: String, userId: String, completion: @escaping ([AnyHashable : Any]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    直播频道号

    vid

    回放点播视频vid

    appId

    云直播账号 应用Id

    userId

    云直播账号 用户Id

  • Deprecated

    已废弃,请使用verifyLivePermissionWithChannelId:userId:appId:completion:failure:

    直播登录校验 API(v1.0.0版本+) 直播相关参数校验:channelId、userId、appId、appSecret

    Declaration

    Objective-C

    + (void)verifyLivePermissionWithChannelId:(NSUInteger)channelId
                                       userId:(nonnull NSString *)userId
                                        appId:(nonnull NSString *)appId
                                    appSecret:(nonnull NSString *)appSecret
                                   completion:(nonnull void (^)(
                                                  NSDictionary *_Nonnull))completion
                                      failure:(nonnull void (^)(NSError *_Nonnull))
                                                  failure;

    Swift

    class func verifyLivePermission(withChannelId channelId: UInt, userId: String, appId: String, appSecret: String, completion: @escaping ([AnyHashable : Any]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

    userId

    用户Id

    appId

    应用Id

    appSecret

    应用密钥

  • 直播登录校验 API(v1.0.0版本+) 直播相关参数校验:channelId、userId、appId

    Declaration

    Objective-C

    + (void)verifyLivePermissionWithChannelId:(NSUInteger)channelId
                                       userId:(nonnull NSString *)userId
                                        appId:(nonnull NSString *)appId
                                   completion:(nonnull void (^)(
                                                  NSDictionary *_Nonnull))completion
                                      failure:(nonnull void (^)(NSError *_Nonnull))
                                                  failure;

    Swift

    class func verifyLivePermission(withChannelId channelId: UInt, userId: String, appId: String, completion: @escaping ([AnyHashable : Any]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

    userId

    用户Id

    appId

    应用Id

  • Deprecated

    已废弃,请使用verifyVodPermissionWithChannelId:vid:userId:appId:completion:failure:

    回放登录校验 API(v1.0.0版本+) 回放相关参数校验:channelId、vid、userId、appId、appSecret

    Declaration

    Objective-C

    + (void)verifyVodPermissionWithChannelId:(NSUInteger)channelId
                                         vid:(nonnull NSString *)vid
                                      userId:(nonnull NSString *)userId
                                       appId:(nonnull NSString *)appId
                                   appSecret:(nonnull NSString *)appSecret
                                  completion:(nonnull void (^)(
                                                 NSDictionary *_Nonnull))completion
                                     failure:(nonnull void (^)(NSError *_Nonnull))
                                                 failure;

    Swift

    class func verifyVodPermission(withChannelId channelId: UInt, vid: String, userId: String, appId: String, appSecret: String, completion: @escaping ([AnyHashable : Any]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

    vid

    回放点播视频vid

    userId

    用户Id

    appId

    应用Id

    appSecret

    应用密钥

  • 回放登录校验 API(v1.0.0版本+) 回放相关参数校验:channelId、vid、userId、appId

    Declaration

    Objective-C

    + (void)verifyVodPermissionWithChannelId:(NSUInteger)channelId
                                         vid:(nonnull NSString *)vid
                                      userId:(nonnull NSString *)userId
                                       appId:(nonnull NSString *)appId
                                  completion:(nonnull void (^)(
                                                 NSDictionary *_Nonnull))completion
                                     failure:(nonnull void (^)(NSError *_Nonnull))
                                                 failure;

    Swift

    class func verifyVodPermission(withChannelId channelId: UInt, vid: String, userId: String, appId: String, completion: @escaping ([AnyHashable : Any]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    vid

    回放点播视频vid

    userId

    用户Id

    appId

    应用Id

  • 推流登录,获取推流的频道信息

    Declaration

    Objective-C

    + (void)loadPushInfoWithChannelId:(nonnull NSString *)channelId
                             password:(nonnull NSString *)password
                          channelType:(PLVChannelType)channelType
                           completion:
                               (nonnull void (^)(NSDictionary *_Nonnull,
                                                 NSString *_Nonnull))completion
                              failure:(nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func loadPushInfo(withChannelId channelId: String, password: String, channelType: Any!, completion: @escaping ([AnyHashable : Any], String) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

    password

    频道密码

    channelType

    频道类型,目前只支持(‘ppt’-三分屏/‘alone’-纯视频)两种频道类型

    completion

    成功回调

    failure

    失败回调

获取频道类型 & 直播状态

  • 校验后,根据channelId获取该频道的类型(普通直播,云课堂),和是否正在直播(废弃从0.13.1)

    Declaration

    Objective-C

    + (void)liveStatus:(nonnull NSString *)channelId
            completion:(nonnull void (^)(BOOL, NSString *_Nonnull))completion
               failure:(nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func liveStatus(_ channelId: String, completion: @escaping (Bool, String) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

  • 获取频道的直播类型、直播流状态(v2)

    Declaration

    Objective-C

    + (void)liveStatus2:(nonnull NSString *)channelId
             completion:(nonnull void (^)(PLVChannelType,
                                          PLVChannelLiveStreamState))completion
                failure:(nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func liveStatus2(_ channelId: String, completion: @escaping (Int32, Int32) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号ID

    completion

    请求完成Block (channelType:频道类型 streamState:当前直播流状态)

    failure

    请求失败Block

  • 获取频道的直播类型、直播流状态(v3)

    Declaration

    Objective-C

    + (void)liveStatus2:(nonnull NSString *)channelId
                  appId:(nonnull NSString *)appId
              appSecret:(nonnull NSString *)appSecret
             completion:(nonnull void (^)(PLVChannelType,
                                          PLVChannelLiveStreamState))completion
                failure:(nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func liveStatus2(_ channelId: String, appId: String, appSecret: String, completion: @escaping (Int32, Int32) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号ID

    appId

    云直播账号 应用Id

    appSecret

    云直播账号 应用密钥

    completion

    请求完成Block (channelType:频道类型 streamState:当前直播流状态)

    failure

    请求失败Block

  • 登录界面,校验后,根据vodId获取该频道的类型(普通直播,云课堂)

    Declaration

    Objective-C

    + (void)getVodType:(nonnull NSString *)vodId
            completion:(nonnull void (^)(PLVChannelType))completion
               failure:(nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func getVodType(_ vodId: String, completion: @escaping (Int32) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    vodId

    回放视频ID

  • 登录界面,校验后,根据文件Id获取该频道的类型(普通直播,云课堂)

    Declaration

    Objective-C

    + (void)
        getLiveRecordTypeWithChannelId:(nonnull NSString *)channelId
                                fileId:(nonnull NSString *)fileId
                                 appId:(nonnull NSString *)appId
                             appSecret:(nonnull NSString *)appSecret
                            completion:(nonnull void (^)(PLVChannelType))completion
                               failure:(nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func getLiveRecordType(withChannelId channelId: String, fileId: String, appId: String, appSecret: String, completion: Any!, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    直播频道号

    fileId

    文件Id

    appId

    云直播账号 应用Id

    appSecret

    云直播账号 应用密钥

  • 获取频道菜单列表

    Declaration

    Objective-C

    + (void)getChannelMenuInfos:(nonnull NSString *)channelId
                     completion:
                         (nonnull void (^)(PLVLiveVideoChannelMenuInfo *_Nonnull))
                             completion
                        failure:(nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func getChannelMenuInfos(_ channelId: String, completion: @escaping (PLVLiveVideoChannelMenuInfo) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

  • 修改频道名

    Declaration

    Objective-C

    + (void)updateChannelName:(nonnull NSString *)channelName
                    channelId:(nonnull NSString *)channelId
                   completion:(nonnull void (^)(void))completion
                      failure:(nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func updateChannelName(_ channelName: String, channelId: String, completion: @escaping () -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelName

    频道名称

    channelId

    频道号

文档

  • 根据频道号 channelId 获取 文档列表数据

    Note

    用于 手机开播(三分屏)场景

    Declaration

    Objective-C

    + (void)requestDocumentListWithChannelId:(nonnull NSString *)channelId
                                  completion:(nonnull void (^)(
                                                 NSArray<NSDictionary *> *_Nonnull))
                                                 completion
                                     failure:(nonnull void (^)(NSError *_Nonnull))
                                                 failure;

    Swift

    class func requestDocumentList(withChannelId channelId: String, completion: @escaping ([[AnyHashable : Any]]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

  • Deprecated

    Please use ‘requestDocumentListWithLessonId:courseCode:teacher:completion:failure:’ instead

    获取文档列表数据

    Note

    用于 互动学堂 场景

    Declaration

    Objective-C

    + (void)requestDocumentListWithLessonId:(nonnull NSString *)lessonId
                                 completion:(nonnull void (^)(
                                                NSArray<NSDictionary *> *_Nonnull))
                                                completion
                                    failure:(nonnull void (^)(NSError *_Nonnull))
                                                failure;

    Swift

    class func requestDocumentList(withLessonId lessonId: String, completion: @escaping ([[AnyHashable : Any]]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    lessonId

    课节ID

    completion

    成功回调

    failure

    失败回调

  • 获取文档列表数据

    Note

    用于 互动学堂 场景

    Declaration

    Objective-C

    + (void)requestDocumentListWithLessonId:(nonnull NSString *)lessonId
                                 courseCode:(NSString *_Nullable)courseCode
                                    teacher:(BOOL)teacher
                                 completion:(nonnull void (^)(
                                                NSArray<NSDictionary *> *_Nonnull))
                                                completion
                                    failure:(nonnull void (^)(NSError *_Nonnull))
                                                failure;

    Swift

    class func requestDocumentList(withLessonId lessonId: String, courseCode: String?, teacher: Bool, completion: @escaping ([[AnyHashable : Any]]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    lessonId

    课节ID

    courseCode

    课程号

    teacher

    是否为讲师

    completion

    成功回调

    failure

    失败回调

  • 根据频道号 channelId、文件ID fileId 删除某个文档

    Declaration

    Objective-C

    + (void)deleteDocumentWithChannelId:(NSString *_Nullable)channelId
                                 fileId:(nonnull NSString *)fileId
                             completion:(nonnull void (^)(void))completion
                                failure:
                                    (nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func deleteDocument(withChannelId channelId: String?, fileId: String, completion: @escaping () -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

    fileId

    文件ID

  • 获取 PPT 文档转码结果

    Note

    用于 手机开播(三分屏)场景

    Declaration

    Objective-C

    + (void)getDocumentConvertStatusWithChannelId:(nonnull NSString *)channelId
                                           fileId:(nonnull NSString *)fileId
                                       completion:
                                           (nonnull void (^)(
                                               NSArray<NSDictionary *> *_Nonnull))
                                               completion
                                          failure:(nonnull void (^)(
                                                      NSError *_Nonnull))failure;

    Swift

    class func getDocumentConvertStatus(withChannelId channelId: String, fileId: String, completion: @escaping ([[AnyHashable : Any]]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

    fileId

    文件ID

  • Deprecated

    Please use ‘getDocumentConvertStatusWithLessonId:fileId:courseCode:teacher:completion:failure:’ instead

    获取 PPT 文档转码结果

    Note

    用于 互动学堂 场景

    Declaration

    Objective-C

    + (void)
        getDocumentConvertStatusWithLessonId:(nonnull NSString *)lessonId
                                      fileId:(nonnull NSString *)fileId
                                  completion:(nonnull void (^)(
                                                 NSArray<NSDictionary *> *_Nonnull))
                                                 completion
                                     failure:(nonnull void (^)(NSError *_Nonnull))
                                                 failure;

    Swift

    class func getDocumentConvertStatus(withLessonId lessonId: String, fileId: String, completion: @escaping ([[AnyHashable : Any]]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    lessonId

    课程号

    fileId

    文件ID

    completion

    成功回调

    failure

    失败回调

  • 获取 PPT 文档转码结果

    Note

    用于 互动学堂 场景

    Declaration

    Objective-C

    + (void)
        getDocumentConvertStatusWithLessonId:(nonnull NSString *)lessonId
                                      fileId:(nonnull NSString *)fileId
                                  courseCode:(NSString *_Nullable)courseCode
                                     teacher:(BOOL)teacher
                                  completion:(nonnull void (^)(
                                                 NSArray<NSDictionary *> *_Nonnull))
                                                 completion
                                     failure:(nonnull void (^)(NSError *_Nonnull))
                                                 failure;

    Swift

    class func getDocumentConvertStatus(withLessonId lessonId: String, fileId: String, courseCode: String?, teacher: Bool, completion: @escaping ([[AnyHashable : Any]]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    lessonId

    课程号

    fileId

    文件ID

    courseCode

    课程号

    teacher

    是否为讲师

    completion

    成功回调

    failure

    失败回调

聊天室相关

  • 获取 chatToken

    Declaration

    Objective-C

    + (void)getChatTokenWithChannelId:(nonnull NSString *)channelId
                               userId:(nonnull NSString *)userId
                                 role:(nonnull NSString *)role
                              groupId:(NSString *_Nullable)groupId
                           completion:
                               (nonnull void (^)(NSDictionary *_Nonnull))completion
                              failure:(nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func getChatToken(withChannelId channelId: String, userId: String, role: String, groupId: String?, completion: @escaping ([AnyHashable : Any]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

    userId

    聊天室用户ID

    role

    聊天室用户角色 @Param groupId 聊天室分组Id

  • 获取 chatToken,分组Id默认为空

    Declaration

    Objective-C

    + (void)getChatTokenWithChannelId:(nonnull NSString *)channelId
                               userId:(nonnull NSString *)userId
                                 role:(nonnull NSString *)role
                           completion:
                               (nonnull void (^)(NSDictionary *_Nonnull))completion
                              failure:(nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func getChatToken(withChannelId channelId: String, userId: String, role: String, completion: @escaping ([AnyHashable : Any]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

    userId

    聊天室用户ID

    role

    聊天室用户角色

  • 获取 chatToken,身份默认为 viewer

    Declaration

    Objective-C

    + (void)getChatTokenWithChannelId:(nonnull NSString *)channelId
                               userId:(nonnull NSString *)userId
                           completion:
                               (nonnull void (^)(NSDictionary *_Nonnull))completion
                              failure:(nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func getChatToken(withChannelId channelId: String, userId: String, completion: @escaping ([AnyHashable : Any]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

    userId

    聊天室用户ID

  • 加载聊天室开关信息

    Declaration

    Objective-C

    + (void)loadChatroomFunctionSwitchWithRoomId:(NSUInteger)roomId
                                      completion:
                                          (nonnull void (^)(NSDictionary *_Nonnull))
                                              completion
                                         failure:(void (^_Nullable)(
                                                     NSError *_Nonnull))failure;

    Swift

    class func loadChatroomFunctionSwitch(withRoomId roomId: UInt, completion: @escaping ([AnyHashable : Any]) -> Void, failure: ((Error) -> Void)? = nil)

    Parameters

    roomId

    频道号

  • 根据时间戳加载聊天室历史记录

    Declaration

    Objective-C

    + (void)requestChatRoomHistoryWithRoomId:(nonnull NSString *)roomId
                                       index:(NSUInteger)index
                                        size:(NSInteger)size
                                   timestamp:(nonnull NSString *)timestamp
                                       order:(BOOL)order
                                  completion:(nonnull void (^)(NSArray *_Nonnull))
                                                 completion
                                     failure:(nonnull void (^)(NSError *_Nonnull))
                                                 failure;

    Swift

    class func requestChatRoomHistory(withRoomId roomId: String, index: UInt, size: Int, timestamp: String, order: Bool, completion: @escaping ([Any]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    roomId

    频道号

    index

    如果目前展示的消息已经有time为timestamp,且有1条,index不用传或者传1。假如有两条,则index传2,三条传3,依此类推。

    size

    每页长度

    timestamp

    从该时间戳开始获取,不传表示获取最新的数据

    order

    数据根据时间戳的顺序,YES表示从小到大,NO表示从大到小

  • 加载聊天室历史记录

    Declaration

    Objective-C

    + (void)requestChatRoomHistoryWithRoomId:(nonnull NSString *)roomId
                                  startIndex:(NSUInteger)startIndex
                                    endIndex:(NSInteger)endIndex
                                  completion:(nonnull void (^)(NSArray *_Nonnull))
                                                 completion
                                     failure:(nonnull void (^)(NSError *_Nonnull))
                                                 failure;

    Swift

    class func requestChatRoomHistory(withRoomId roomId: String, start startIndex: UInt, end endIndex: Int, completion: @escaping ([Any]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    roomId

    频道号

    startIndex

    开始index

    endIndex

    结束index

  • 获取聊天室在线人数列表接口 1

    Declaration

    Objective-C

    + (void)requestChatRoomListUsersWithRoomId:(nonnull NSString *)roomId
                                          page:(NSUInteger)page
                                        length:(NSUInteger)length
                                      streamer:(BOOL)streamer
                                       success:(nonnull void (^)(
                                                   NSDictionary *_Nonnull))success
                                       failure:(void (^_Nullable)(
                                                   NSError *_Nonnull))failure;

    Swift

    class func requestChatRoomListUsers(withRoomId roomId: String, page: UInt, length: UInt, streamer: Bool, success: @escaping ([AnyHashable : Any]) -> Void, failure: ((Error) -> Void)? = nil)

    Parameters

    roomId

    频道号/房间号

    page

    页码

    length

    一页的数据条数

    streamer

    YES-当前用户为讲师和特殊身份,返回classStatus字段(非讲师身份不可为YES,会有性能问题)

  • 获取聊天室在线人数列表接口 2

    Declaration

    Objective-C

    + (void)requestChatRoomListUsersWithRoomId:(nonnull NSString *)roomId
                                          page:(NSUInteger)page
                                        length:(NSUInteger)length
                                     sessionId:(NSString *_Nullable)sessionId
                                      streamer:(BOOL)streamer
                                       success:(nonnull void (^)(
                                                   NSDictionary *_Nonnull))success
                                       failure:(void (^_Nullable)(
                                                   NSError *_Nonnull))failure;

    Swift

    class func requestChatRoomListUsers(withRoomId roomId: String, page: UInt, length: UInt, sessionId: String?, streamer: Bool, success: @escaping ([AnyHashable : Any]) -> Void, failure: ((Error) -> Void)? = nil)

    Parameters

    roomId

    频道号/房间号

    page

    页码

    length

    一页的数据条数

    sessionId

    场次ID,目前该参数只用于互动学堂场景

    streamer

    YES-当前用户为讲师和特殊身份,返回classStatus字段(非讲师身份不可为YES,会有性能问题)

  • 获取聊天室具体房间号被踢出的用户列表

    Declaration

    Objective-C

    + (void)
        requestChatRoomListKickedWithRoomId:(nonnull NSString *)roomId
                                    success:
                                        (nonnull void (^)(NSArray *_Nonnull))success
                                    failure:(nonnull void (^)(NSError *_Nonnull))
                                                failure;

    Swift

    class func requestChatRoomListKicked(withRoomId roomId: String, success: @escaping ([Any]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    roomId

    频道号/房间号

  • 获取图片表情列表接口

    Declaration

    Objective-C

    + (void)
        requestEmotionImagesWithRoomId:(NSUInteger)roomId
                             accountId:(nonnull NSString *)accountId
                                  page:(NSUInteger)page
                                  size:(NSUInteger)size
                               success:
                                   (nonnull void (^)(NSDictionary *_Nonnull))success
                               failure:
                                   (void (^_Nullable)(NSError *_Nonnull))failure;

    Swift

    class func requestEmotionImages(withRoomId roomId: UInt, accountId: String, page: UInt, size: UInt, success: @escaping ([AnyHashable : Any]) -> Void, failure: ((Error) -> Void)? = nil)

    Parameters

    roomId

    频道号/房间号

    accountId

    账号Id

    page

    页码

    size

    一页的数据条数

  • 点赞

    Declaration

    Objective-C

    + (void)likeWithChannelId:(NSUInteger)channelId
                     viewerId:(nonnull NSString *)viewerId
                        times:(NSUInteger)times
                   completion:(nonnull void (^)(void))completion
                      failure:(void (^_Nullable)(NSError *_Nonnull))failure;

    Swift

    class func like(withChannelId channelId: UInt, viewerId: String, times: UInt, completion: @escaping () -> Void, failure: ((Error) -> Void)? = nil)

    Parameters

    channelId

    频道号

    viewerId

    聊天室用户Id

    times

    某段时间内新增点赞数

  • 发送图片

    Declaration

    Objective-C

    + (void)uploadImage:(id)image
              imageName:(nonnull NSString *)imageName
              channelId:(nonnull NSString *)channelId
               progress:(nonnull void (^)(float))progressBlock
                success:(nonnull void (^)(NSDictionary *_Nonnull,
                                          NSString *_Nonnull,
                                          NSString *_Nonnull))successBlock
                   fail:(nonnull void (^)(NSError *_Nonnull))failBlock;

    Swift

    class func uploadImage(_ image: Any!, imageName: String, channelId: String, progress progressBlock: @escaping (Float) -> Void, success successBlock: @escaping ([AnyHashable : Any], String, String) -> Void, fail failBlock: @escaping (Error) -> Void)

    Parameters

    image

    图片

    imageName

    图片名字

    channelId

    频道号

  • Deprecated

    已废弃,请使用uploadImage:imageName:channelId:progress:success:fail:

    发送图片

    Note

    使用该方法上传的图片,会压缩到小于2MB为止

    Declaration

    Objective-C

    + (void)uploadImage:(id)image
              imageName:(nonnull NSString *)imageName
               progress:(nonnull void (^)(float))progressBlock
                success:(nonnull void (^)(NSDictionary *_Nonnull,
                                          NSString *_Nonnull,
                                          NSString *_Nonnull))successBlock
                   fail:(nonnull void (^)(NSError *_Nonnull))failBlock;

    Swift

    class func uploadImage(_ image: Any!, imageName: String, progress progressBlock: @escaping (Float) -> Void, success successBlock: @escaping ([AnyHashable : Any], String, String) -> Void, fail failBlock: @escaping (Error) -> Void)

    Parameters

    image

    图片

    imageName

    图片名字

  • 发送图片

    Note

    使用该方法上传的图片,不会再进行压缩

    Declaration

    Objective-C

    + (void)uploadImageData:(nonnull NSData *)imageData
                  imageName:(nonnull NSString *)imageName
                  channelId:(nonnull NSString *)channelId
                   progress:(nonnull void (^)(float))progressBlock
                    success:(nonnull void (^)(NSDictionary *_Nonnull,
                                              NSString *_Nonnull,
                                              NSString *_Nonnull))successBlock
                       fail:(nonnull void (^)(NSError *_Nonnull))failBlock;

    Swift

    class func uploadImageData(_ imageData: Data, imageName: String, channelId: String, progress progressBlock: @escaping (Float) -> Void, success successBlock: @escaping ([AnyHashable : Any], String, String) -> Void, fail failBlock: @escaping (Error) -> Void)

    Parameters

    imageData

    图片数据

    imageName

    图片名字

    channelId

    频道号

  • Deprecated

    已废弃,请使用uploadImageData:imageName:channelId:progress:success:fail:

    发送图片

    Note

    使用该方法上传的图片,不会再进行压缩

    Declaration

    Objective-C

    + (void)uploadImageData:(nonnull NSData *)imageData
                  imageName:(nonnull NSString *)imageName
                   progress:(nonnull void (^)(float))progressBlock
                    success:(nonnull void (^)(NSDictionary *_Nonnull,
                                              NSString *_Nonnull,
                                              NSString *_Nonnull))successBlock
                       fail:(nonnull void (^)(NSError *_Nonnull))failBlock;

    Swift

    class func uploadImageData(_ imageData: Data, imageName: String, progress progressBlock: @escaping (Float) -> Void, success successBlock: @escaping ([AnyHashable : Any], String, String) -> Void, fail failBlock: @escaping (Error) -> Void)

    Parameters

    imageData

    图片数据

    imageName

    图片名字

  • 增加播放热度

    Declaration

    Objective-C

    + (void)increaseViewerWithChannelId:(nonnull NSString *)channelId
                                  times:(NSUInteger)times
                             completion:(nonnull void (^)(NSInteger))completion
                                failure:
                                    (nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func increaseViewer(withChannelId channelId: String, times: UInt, completion: @escaping (Int) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

    times

    新增 socket login 次数(收到自己的 login 消息一次 times +1)

  • 获取当前观看次数

    Declaration

    Objective-C

    + (void)requestPageViewWithChannelId:(nonnull NSString *)channelId
                              completion:(nonnull void (^)(NSDictionary *_Nonnull))
                                             completion
                                 failure:
                                     (nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func requestPageView(withChannelId channelId: String, completion: @escaping ([AnyHashable : Any]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

  • 加载聊天室提醒消息历史记录

    Declaration

    Objective-C

    + (void)requestChatRoomRemindHistoryWithRoomId:(nonnull NSString *)roomId
                                        startIndex:(NSUInteger)startIndex
                                          endIndex:(NSInteger)endIndex
                                        completion:(nonnull void (^)(
                                                       NSArray *_Nonnull))completion
                                           failure:(nonnull void (^)(
                                                       NSError *_Nonnull))failure;

    Swift

    class func requestChatRoomRemindHistory(withRoomId roomId: String, start startIndex: UInt, end endIndex: Int, completion: @escaping ([Any]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    roomId

    频道号

    startIndex

    开始index

    endIndex

    结束index

    completion

    成功回调

    failure

    失败回调

  • 获取最新红包

    Declaration

    Objective-C

    + (void)requestNewestRedpackWithChannelId:(nonnull NSString *)channelId
                                   completion:(nonnull void (^)(
                                                  NSDictionary *_Nonnull))completion
                                      failure:(void (^_Nullable)(NSError *_Nonnull))
                                                  failure;

    Swift

    class func requestNewestRedpack(withChannelId channelId: String, completion: @escaping ([AnyHashable : Any]) -> Void, failure: ((Error) -> Void)? = nil)

    Parameters

    channelId

    频道号

    completion

    成功回调

    failure

    失败回调

  • 判断观众是否已抢红包

    Declaration

    Objective-C

    + (void)requestRedpackReceiveCacheWithChannelId:(nonnull NSString *)channelId
                                           viewerId:(nonnull NSString *)viewerId
                                          redpackId:(nonnull NSString *)redpackId
                                         redCacheId:(nonnull NSString *)redCacheId
                                         completion:
                                             (nonnull void (^)(
                                                 NSDictionary *_Nonnull))completion
                                            failure:(void (^_Nullable)(
                                                        NSError *_Nonnull))failure;

    Swift

    class func requestRedpackReceiveCache(withChannelId channelId: String, viewerId: String, redpackId: String, redCacheId: String, completion: @escaping ([AnyHashable : Any]) -> Void, failure: ((Error) -> Void)? = nil)

    Parameters

    channelId

    频道号

    viewerId

    观众viewerId

    redpackId

    红包ID

    redCacheId

    红包CacheID

    completion

    成功回调

    failure

    失败回调

  • 加载聊天室提问消息历史记录

    Declaration

    Objective-C

    + (void)requestChatRoomQuestionHistoryWithRoomId:(nonnull NSString *)roomId
                                                page:(NSUInteger)page
                                            pageSize:(NSInteger)pageSize
                                          completion:
                                              (nonnull void (^)(
                                                  NSDictionary *_Nonnull))completion
                                             failure:(nonnull void (^)(
                                                         NSError *_Nonnull))failure;

    Swift

    class func requestChatRoomQuestionHistory(withRoomId roomId: String, page: UInt, pageSize: Int, completion: @escaping ([AnyHashable : Any]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    roomId

    频道号

    page

    页码

    pageSize

    每页的size

    completion

    成功回调

    failure

    失败回调

连麦相关

  • 普通直播,获取推流端是旧的推流端(主讲人走CDN视频,连麦走RTC音频),还是新的推流端(主讲人走RTC视频,连麦走RTC)

    Declaration

    Objective-C

    + (void)rtcEnabled:(NSUInteger)channelId
            completion:(nonnull void (^)(BOOL))completion
               failure:(nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func rtcEnabled(_ channelId: UInt, completion: @escaping (Bool) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

  • 检测当前连麦状态

    Declaration

    Objective-C

    + (void)requestLinkMicStatusWithRoomId:(NSUInteger)roomId
                                completion:
                                    (nonnull void (^)(NSString *_Nonnull,
                                                      NSString *_Nonnull))completion
                                   failure:
                                       (nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func requestLinkMicStatus(withRoomId roomId: UInt, completion: @escaping (String, String) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    roomId

    频道号

  • 获取当前连麦列表

    Declaration

    Objective-C

    + (void)requestLinkMicOnlineListWithRoomId:(nonnull NSString *)roomId
                                     sessionId:(nonnull NSString *)sessionId
                                    completion:
                                        (nonnull void (^)(NSDictionary *_Nonnull))
                                            completion
                                       failure:(nonnull void (^)(NSError *_Nonnull))
                                                   failure;

    Swift

    class func requestLinkMicOnlineList(withRoomId roomId: String, sessionId: String, completion: @escaping ([AnyHashable : Any]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    roomId

    频道号

    sessionId

    当前直播的sessionId

  • 获取当前连麦列表

    Declaration

    Objective-C

    + (void)requestLinkMicOnlineListWithRoomId:(nonnull NSString *)roomId
                                     sessionId:(nonnull NSString *)sessionId
                                   getSubRooms:(BOOL)getSubRooms
                                    completion:
                                        (nonnull void (^)(NSDictionary *_Nonnull))
                                            completion
                                       failure:(nonnull void (^)(NSError *_Nonnull))
                                                   failure;

    Swift

    class func requestLinkMicOnlineList(withRoomId roomId: String, sessionId: String, getSubRooms: Bool, completion: @escaping ([AnyHashable : Any]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    roomId

    频道号

    sessionId

    当前直播的sessionId

    getSubRooms

    是否获取转播子频道信息,默认为NO

  • 连麦id和聊天室用户id关联

    Declaration

    Objective-C

    + (void)requestViewerIdLinkMicIdRelate:(nonnull NSString *)channelId
                                  viewerId:(nonnull NSString *)viewerId
                                 linkMicId:(nonnull NSString *)linkMicId
                                completion:(nullable void (^)(void))completion
                                   failure:(nullable void (^)(NSError *_Nonnull))
                                               failure;

    Swift

    class func requestViewerIdLinkMicIdRelate(_ channelId: String, viewerId: String, linkMicId: String, completion: (() -> Void)?, failure: ((Error) -> Void)? = nil)

    Parameters

    channelId

    频道号

    viewerId

    聊天室的用户Id

    linkMicId

    连麦id

  • 强制下麦

    Declaration

    Objective-C

    + (void)requestLinkMicRemoveUser:(nonnull NSString *)channelId
                              userId:(nonnull NSString *)userId
                           linkMicId:(nonnull NSString *)linkMicId
                          completion:(nonnull void (^)(BOOL))completion
                             failure:(nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func requestLinkMicRemoveUser(_ channelId: String, userId: String, linkMicId: String, completion: @escaping (Bool) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

    userId

    连麦用户ID

    linkMicId

    连麦id

SIP相关

  • 获取SIP入会信息

    Declaration

    Objective-C

    + (void)requestSIPInfoWithChannelId:(nonnull NSString *)channelId
                             completion:(nonnull void (^)(NSDictionary *_Nonnull))
                                            completion
                                failure:
                                    (nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func requestSIPInfo(withChannelId channelId: String, completion: @escaping ([AnyHashable : Any]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

  • 获取当前拨号情况列表

    Declaration

    Objective-C

    + (void)requestSIPDialLinesListWithChannelId:(nonnull NSString *)channelId
                                      completion:
                                          (nonnull void (^)(NSDictionary *_Nonnull))
                                              completion
                                         failure:(nonnull void (^)(
                                                     NSError *_Nonnull))failure;

    Swift

    class func requestSIPDialLinesList(withChannelId channelId: String, completion: @escaping ([AnyHashable : Any]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

抽奖

  • 发送中奖信息(自 v0.11.1 失效)

    Declaration

    Objective-C

    + (void)postLotteryWithData:(nonnull NSDictionary *)data
                     completion:(nonnull void (^)(void))completion
                        failure:(nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func postLottery(withData data: [AnyHashable : Any], completion: @escaping () -> Void, failure: @escaping (Error) -> Void)

    Parameters

    data

    中奖信息

  • 发送中奖信息(自 v0.11.1 生效)

    Declaration

    Objective-C

    + (void)newPostLotteryWithData:(nonnull NSDictionary *)data
                        completion:(nonnull void (^)(void))completion
                           failure:(nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func newPostLottery(withData data: [AnyHashable : Any], completion: @escaping () -> Void, failure: @escaping (Error) -> Void)

    Parameters

    data

    中奖信息

  • 放弃领奖

    Declaration

    Objective-C

    + (void)giveUpReceiveWithChannelId:(nonnull NSString *)channelId
                                userId:(nonnull NSString *)userId
                            completion:
                                (nonnull void (^)(NSString *_Nonnull))completion
                               failure:(nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func giveUpReceive(withChannelId channelId: String, userId: String, completion: @escaping (String) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

    userId

    聊天室用户ID

礼物打赏

  • 获取该频道打赏设置

    Declaration

    Objective-C

    + (void)requestRewardWithChannelId:(nonnull NSString *)channelId
                            completion:
                                (nonnull void (^)(NSDictionary *_Nonnull))completion
                               failure:(nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func requestReward(withChannelId channelId: String, completion: @escaping ([AnyHashable : Any]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

  • 获取该频道积分打赏设置

    Declaration

    Objective-C

    + (void)requestPointSettingWithChannelId:(NSUInteger)channelId
                                  completion:(nullable void (^)(
                                                 NSDictionary *_Nonnull))completion
                                     failure:(nullable void (^)(NSError *_Nonnull))
                                                 failure;

    Swift

    class func requestPointSetting(withChannelId channelId: UInt, completion: (([AnyHashable : Any]) -> Void)?, failure: ((Error) -> Void)? = nil)

    Parameters

    channelId

    频道号

  • 获取观众的积分信息

    Declaration

    Objective-C

    + (void)requestViewerPointWithViewerId:(nonnull NSString *)viewerId
                                  nickName:(nonnull NSString *)nickName
                                 channelId:(NSUInteger)channelId
                                completion:(nullable void (^)(NSString *_Nonnull))
                                               completion
                                   failure:(nullable void (^)(NSError *_Nonnull))
                                               failure;

    Swift

    class func requestViewerPoint(withViewerId viewerId: String, nickName: String, channelId: UInt, completion: ((String) -> Void)?, failure: ((Error) -> Void)? = nil)

    Parameters

    viewerId

    聊天室用户Id

    nickName

    观众的用户昵称

    channelId

    频道号

  • 观众打赏积分道具

    Declaration

    Objective-C

    + (void)requestViewerRewardPointWithViewerId:(nonnull NSString *)viewerId
                                        nickName:(nonnull NSString *)nickName
                                          avatar:(nonnull NSString *)avatar
                                          goodId:(NSInteger)goodId
                                         goodNum:(NSInteger)goodNum
                                       channelId:(NSUInteger)channelId
                                      completion:(nullable void (^)(
                                                     NSString *_Nonnull))completion
                                         failure:(nullable void (^)(
                                                     NSError *_Nonnull))failure;

    Swift

    class func requestViewerRewardPoint(withViewerId viewerId: String, nickName: String, avatar: String, goodId: Int, goodNum: Int, channelId: UInt, completion: ((String) -> Void)?, failure: ((Error) -> Void)? = nil)

    Parameters

    viewerId

    聊天室用户Id

    nickName

    观众的昵称

    avatar

    观众的头像地址

    goodId

    商品id

    goodNum

    商品数量

    channelId

    频道号

  • 观众打赏免费道具

    Declaration

    Objective-C

    + (void)requestViewerFreeDonateRewardWithViewerId:(nonnull NSString *)viewerId
                                             nickName:(nonnull NSString *)nickName
                                               avatar:(nonnull NSString *)avatar
                                               goodId:(NSInteger)goodId
                                              goodNum:(NSInteger)goodNum
                                            channelId:(NSUInteger)channelId
                                            sessionId:(nonnull NSString *)sessionId
                                           completion:
                                               (nullable void (^)(void))completion
                                              failure:
                                                  (nullable void (^)(
                                                      NSError *_Nonnull))failure;

    Swift

    class func requestViewerFreeDonateReward(withViewerId viewerId: String, nickName: String, avatar: String, goodId: Int, goodNum: Int, channelId: UInt, sessionId: String, completion: (() -> Void)?, failure: ((Error) -> Void)? = nil)

    Parameters

    viewerId

    聊天室用户Id

    nickName

    观众的昵称

    avatar

    观众的头像地址

    goodId

    商品id

    goodNum

    商品数量

    channelId

    频道号

    sessionId

    场次号

  • 获取卡片推送相关信息

    Declaration

    Objective-C

    + (void)requestCardPushInfoWithChannelId:(nonnull NSString *)channelId
                                  cardPushId:(nonnull NSString *)cardPushId
                                  completion:(nonnull void (^)(
                                                 NSDictionary *_Nonnull))completion
                                     failure:(nullable void (^)(NSError *_Nonnull))
                                                 failure;

    Swift

    class func requestCardPushInfo(withChannelId channelId: String, cardPushId: String, completion: @escaping ([AnyHashable : Any]) -> Void, failure: ((Error) -> Void)? = nil)

    Parameters

    channelId

    频道id

    cardPushId

    商品推送id

  • 查询频道打赏设置(新版后台)

    Declaration

    Objective-C

    + (void)requestDonateWithChannelId:(nonnull NSString *)channelId
                            completion:
                                (nonnull void (^)(NSDictionary *_Nonnull))completion
                               failure:(nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func requestDonate(withChannelId channelId: String, completion: @escaping ([AnyHashable : Any]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

  • 修改频道礼物打赏开关

    Declaration

    Objective-C

    + (void)updateDonateGiftWithChannelId:(nonnull NSString *)channelId
                        donateGiftEnabled:(BOOL)donateGiftEnabled
                               completion:(nullable void (^)(void))completion
                                  failure:
                                      (nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func updateDonateGift(withChannelId channelId: String, donateGiftEnabled: Bool, completion: (() -> Void)?, failure: @escaping (Error) -> Void)

直播回放

  • 获取视频弹幕信息

    Declaration

    Objective-C

    + (void)loadDanmuWithVid:(nonnull NSString *)vid
                        time:(nonnull NSString *)time
                       msgId:(NSUInteger)msgId
                       limit:(NSUInteger)limit
                  completion:(nonnull void (^)(NSArray *_Nonnull,
                                               NSError *_Nonnull))completion;

    Swift

    class func loadDanmu(withVid vid: String, time: String, msgId: UInt, limit: UInt) async -> ([Any], Error)
  • 新增回放弹幕

    Declaration

    Objective-C

    + (void)addDanmuWithVid:(nonnull NSString *)vid
                        msg:(nonnull NSString *)msg
                       time:(nonnull NSString *)time
                  sessionId:(nonnull NSString *)sessionId
                    msgType:(nonnull NSString *)msgType
                       user:(nonnull NSString *)user
                 completion:(nonnull void (^)(NSDictionary *_Nonnull,
                                              NSError *_Nonnull))completion;

    Swift

    class func addDanmu(withVid vid: String, msg: String, time: String, sessionId: String, msgType: String, user: String) async -> ([AnyHashable : Any], Error)
  • 查询频道回放功能开关

    Declaration

    Objective-C

    + (void)requestPlaybackEnableWithChannelId:(nonnull NSString *)channelId
                                         appId:(nonnull NSString *)appId
                                     appSecret:(nonnull NSString *)appSecret
                                    completion:
                                        (nonnull void (^)(BOOL, NSError *_Nullable))
                                            completion;

    Swift

    class func requestPlaybackEnable(withChannelId channelId: String, appId: String, appSecret: String) async throws -> Bool

    Parameters

    channelId

    频道号

    appId

    用户appId

    appSecret

    用户appSecret

    completion

    请求完成块

  • 查询回放视频的视频列表信息(区分是否是接收转播的频道)

    Declaration

    Objective-C

    + (void)requestPlaybackListWithChannelId:(nonnull NSString *)channelId
                                    listType:(nonnull NSString *)listType
                                        page:(NSUInteger)page
                                    pageSize:(NSUInteger)pageSize
                                       appId:(nonnull NSString *)appId
                                   appSecret:(nonnull NSString *)appSecret
                                  completion:(nonnull void (^)(
                                                 PLVPlaybackListModel *_Nullable,
                                                 NSError *_Nullable))completion;

    Swift

    class func requestPlaybackList(withChannelId channelId: String, listType: String, page: UInt, pageSize: UInt, appId: String, appSecret: String) async throws -> PLVPlaybackListModel

    Parameters

    channelId

    频道号

    listType

    playback-回放列表,vod-点播列表; 默认普通直播场景为vod,三分屏为playback

    page

    页数,默认每页显示12条数据

    pageSize

    每页显示的数据条数,0为默认值

    appId

    用户appId

    appSecret

    用户appSecret

    completion

    请求完成块

  • Deprecated

    已废弃,请使用requestPlaybackListWithChannelId:listType:page:pageSize:appId:appSecret:completion:

    查询回放视频的视频列表信息

    Declaration

    Objective-C

    + (void)requestPlaybackList:(nonnull NSString *)channelId
                       listType:(nonnull NSString *)listType
                           page:(NSUInteger)page
                       pageSize:(NSUInteger)pageSize
                          appId:(nonnull NSString *)appId
                      appSecret:(nonnull NSString *)appSecret
                     completion:(nonnull void (^)(PLVPlaybackListModel *_Nullable,
                                                  NSError *_Nullable))completion;

    Swift

    class func requestPlaybackList(_ channelId: String, listType: String, page: UInt, pageSize: UInt, appId: String, appSecret: String) async throws -> PLVPlaybackListModel

    Parameters

    channelId

    频道号

    listType

    playback-回放列表,vod-点播列表; 默认普通直播场景为vod,三分屏为playback

    page

    页数,默认每页显示12条数据

    pageSize

    每页显示的数据条数,0为默认值

    appId

    用户appId

    appSecret

    用户appSecret

    completion

    请求完成块

  • Deprecated

    已废弃,请使用requestChannelPlaybackSettingWithChannelId:appId:completion:failure:

    查询章节功能开关

    Declaration

    Objective-C

    + (void)
        requestLivePlaybackSectionEnableWithChannelId:(nonnull NSString *)channelId
                                           completion:
                                               (nonnull void (^)(BOOL))completion
                                              failure:
                                                  (nonnull void (^)(
                                                      NSError *_Nullable))failure;

    Swift

    class func requestLivePlaybackSectionEnable(withChannelId channelId: String, completion: @escaping (Bool) -> Void, failure: @escaping (Error?) -> Void)

    Parameters

    channelId

    频道号

    completion

    请求完成块

  • 获取回放章节列表 (v2)

    Declaration

    Objective-C

    + (void)
        requestLivePlaybackSectionListWithChannelId:(nonnull NSString *)channelId
                                            videoId:(nonnull NSString *)videoId
                                              appId:(nonnull NSString *)appId
                                          appSecret:(nonnull NSString *)appSecret
                                         completion:
                                             (nonnull void (^)(
                                                 NSArray<PLVLivePlaybackSectionModel
                                                             *> *_Nonnull,
                                                 NSError *_Nullable))completion;

    Swift

    class func requestLivePlaybackSectionList(withChannelId channelId: String, videoId: String, appId: String, appSecret: String) async throws -> [PLVLivePlaybackSectionModel]

    Parameters

    channelId

    频道号

    videoId

    直播系统生成的回放id

    appId

    用户appId

    appSecret

    用户appSecret

    completion

    请求完成块

  • 获取回放章节列表

    Declaration

    Objective-C

    + (void)
        requestLivePlaybackSectionListWithChannelId:(nonnull NSString *)channelId
                                            videoId:(nonnull NSString *)videoId
                                         completion:
                                             (nonnull void (^)(
                                                 NSArray<PLVLivePlaybackSectionModel
                                                             *> *_Nonnull,
                                                 NSError *_Nullable))completion;

    Swift

    class func requestLivePlaybackSectionList(withChannelId channelId: String, videoId: String) async throws -> [PLVLivePlaybackSectionModel]

    Parameters

    channelId

    频道号

    videoId

    直播系统生成的回放id

    completion

    请求完成块

  • 查询回放功能设置

    Declaration

    Objective-C

    + (void)requestChannelPlaybackInfoWithChannelId:(nonnull NSString *)channelId
                                              appId:(nonnull NSString *)appId
                                          appSecret:(nonnull NSString *)appSecret
                                                vid:(NSString *_Nullable)vid
                                       playbackType:
                                           (NSString *_Nullable)playbackType
                                         completion:(nonnull void (^)(
                                                        PLVChannelPlaybackInfoModel
                                                            *_Nullable))completion
                                            failure:(nonnull void (^)(
                                                        NSError *_Nullable))failure;

    Swift

    class func requestChannelPlaybackInfo(withChannelId channelId: String, appId: String, appSecret: String, vid: String?, playbackType: String?, completion: @escaping (PLVChannelPlaybackInfoModel?) -> Void, failure: @escaping (Error?) -> Void)

    Parameters

    channelId

    频道号

    appId

    用户appId

    vid

    视频vid

    playbackType

    回放类型

    completion

    请求完成块,回放设置可为空

  • Deprecated

    已废弃,请使用requestChannelPlaybackSettingWithChannelId:appId:completion:failure:

    查询回放功能设置

    Declaration

    Objective-C

    + (void)requestChannelPlaybackInfoWithChannelId:(nonnull NSString *)channelId
                                         completion:(nonnull void (^)(
                                                        PLVChannelPlaybackInfoModel
                                                            *_Nullable))completion
                                            failure:(nonnull void (^)(
                                                        NSError *_Nullable))failure;

    Swift

    class func requestChannelPlaybackInfo(withChannelId channelId: String, completion: @escaping (PLVChannelPlaybackInfoModel?) -> Void, failure: @escaping (Error?) -> Void)

    Parameters

    channelId

    频道号

    completion

    请求完成块,回放设置可为空

  • 获取录制文件章节列表 (v2)

    Declaration

    Objective-C

    + (void)
        requestLiveRecordSectionListWithChannelId:(nonnull NSString *)channelId
                                           fileId:(nonnull NSString *)fileId
                                            appId:(nonnull NSString *)appId
                                        appSecret:(nonnull NSString *)appSecret
                                       completion:
                                           (nonnull void (^)(
                                               NSArray<PLVLivePlaybackSectionModel
                                                           *> *_Nonnull,
                                               NSError *_Nullable))completion;

    Swift

    class func requestLiveRecordSectionList(withChannelId channelId: String, fileId: String, appId: String, appSecret: String) async throws -> [PLVLivePlaybackSectionModel]

    Parameters

    channelId

    频道号

    fileId

    录制文件id

    appId

    用户appId

    appSecret

    用户appSecret

    completion

    请求完成块

  • 获取录制文件章节列表

    Declaration

    Objective-C

    + (void)
        requestLiveRecordSectionListWithChannelId:(nonnull NSString *)channelId
                                           fileId:(nonnull NSString *)fileId
                                       completion:
                                           (nonnull void (^)(
                                               NSArray<PLVLivePlaybackSectionModel
                                                           *> *_Nonnull,
                                               NSError *_Nullable))completion;

    Swift

    class func requestLiveRecordSectionList(withChannelId channelId: String, fileId: String) async throws -> [PLVLivePlaybackSectionModel]

    Parameters

    channelId

    频道号

    fileId

    录制文件id

    completion

    请求完成块

  • 修改频道开关状态设置

    Declaration

    Objective-C

    + (void)updatePlaybackSettingWithChannelId:(nonnull NSString *)channelId
                               playbackEnabled:(BOOL)playbackEnabled
                                    completion:(nullable void (^)(void))completion
                                       failure:(nonnull void (^)(NSError *_Nonnull))
                                                   failure;

    Swift

    class func updatePlaybackSetting(withChannelId channelId: String, playbackEnabled: Bool, completion: (() -> Void)?, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

    playbackEnabled

    回放开关状态

    completion

    请求完成块

跑马灯

  • 加载自定义跑马灯

    Declaration

    Objective-C

    + (void)loadCustomMarquee:(nonnull NSURL *)url
                withChannelId:(NSUInteger)channelId
                       userId:(nonnull NSString *)userId
                         code:(nonnull NSString *)code
                   completion:(nonnull void (^)(BOOL,
                                                NSDictionary *_Nonnull))completion
                      failure:(nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func loadCustomMarquee(_ url: URL, withChannelId channelId: UInt, userId: String, code: String, completion: @escaping (Bool, [AnyHashable : Any]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    url

    自定义跑马灯地址

    channelId

    直播频道号

    userId

    云直播账号 用户ID

    code

    自定义跑马灯附带参数

    completion

    加载成功

    failure

    加载失败

商品

  • 获取商品列表

    Declaration

    Objective-C

    + (void)loadCommodityList:(NSUInteger)channelId
                         rank:(NSUInteger)rank
                        count:(NSUInteger)count
                   completion:(nonnull void (^)(
                                  NSUInteger,
                                  NSArray<PLVCommodityModel *> *_Nonnull))completion
                      failure:(nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    class func loadCommodityList(_ channelId: UInt, rank: UInt, count: UInt, completion: @escaping (UInt, [PLVCommodityModel]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

    rank

    排序号 (加载序号以前的商品)

    count

    获取列表数据大小,默认10条,最大20

    completion

    加载成功(返回商品列表顺序与后台显示顺序一致)

    failure

    加载失败

海报

  • 获取邀请海报设置

    Declaration

    Objective-C

    + (void)requestInvitePosterWithChannelId:(nonnull NSString *)channelId
                                     success:(nonnull void (^)(
                                                 NSDictionary *_Nonnull))success
                                     failure:(nonnull void (^)(NSError *_Nonnull))
                                                 failure;

    Swift

    class func requestInvitePoster(withChannelId channelId: String, success: @escaping ([AnyHashable : Any]) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

    success

    请求成功

    failure

    请求失败

推流

  • 更新频道直播状态至结束接口

    Declaration

    Objective-C

    + (void)requestChannelLivestatusEndWithChannelId:(nonnull NSString *)channelId
                                              stream:(nonnull NSString *)stream
                                             success:(nonnull void (^)(
                                                         NSString *_Nonnull))success
                                             failure:(nonnull void (^)(
                                                         NSError *_Nonnull))failure;

    Swift

    class func requestChannelLivestatusEnd(withChannelId channelId: String, stream: String, success: @escaping (String) -> Void, failure: @escaping (Error) -> Void)

    Parameters

    channelId

    频道号

    stream

    流名

    success

    请求成功

    failure

    请求失败

分组

  • 获取分组列表

    Declaration

    Objective-C

    + (void)
        requestGroupListWithChannelId:(nonnull NSString *)channelId
                                appId:(nonnull NSString *)appId
                         channelToken:(nonnull NSString *)channelToken
                              success:(nonnull void (^)(
                                          NSArray<NSDictionary *> *_Nonnull))success
                              failure:(void (^_Nullable)(NSError *_Nonnull))failure;

    Swift

    class func requestGroupList(withChannelId channelId: String, appId: String, channelToken: String, success: @escaping ([[AnyHashable : Any]]) -> Void, failure: ((Error) -> Void)? = nil)

    Parameters

    channelId

    频道号

    appId

    appId

    channelToken

    api频道token

    success

    请求成功

    failure

    请求失败

观看页用户列表

  • 获取观看页用户列表

    Declaration

    Objective-C

    + (void)requestViewerListWithRoomId:(nonnull NSString *)roomId
                                success:(nonnull void (^)(NSDictionary *_Nonnull))
                                            success
                                failure:
                                    (void (^_Nullable)(NSError *_Nonnull))failure;

    Swift

    class func requestViewerList(withRoomId roomId: String, success: @escaping ([AnyHashable : Any]) -> Void, failure: ((Error) -> Void)? = nil)

    Parameters

    roomId

    频道号

    success

    请求成功

    failure

    请求失

  • 获取观看页分组用户列表

    Declaration

    Objective-C

    + (void)requestViewerListWithRoomId:(nonnull NSString *)roomId
                                groupId:(nonnull NSString *)groupId
                                success:(nonnull void (^)(NSDictionary *_Nonnull))
                                            success
                                failure:
                                    (void (^_Nullable)(NSError *_Nonnull))failure;

    Swift

    class func requestViewerList(withRoomId roomId: String, groupId: String, success: @escaping ([AnyHashable : Any]) -> Void, failure: ((Error) -> Void)? = nil)

    Parameters

    roomId

    频道号

    groupId

    分组

    success

    请求成功

    failure

    请求失

多会场

  • Undocumented

    Declaration

    Objective-C

    + (void)requestMultiMeetingListWithChannelId:(NSString *)channelId
                                   mainChannelId:(NSString *)mainChannelId
                                      pageNumber:(NSUInteger)pageNumber
                                        pageSize:(NSUInteger)pageSize
                                         success:(void (^) (NSDictionary *multiMeetingList))success
                                         failure:(void (^ _Nullable)(NSError * error))failure;

    Swift

    class func requestMultiMeetingList(withChannelId channelId: String, mainChannelId: String, pageNumber: UInt, pageSize: UInt, success: @escaping ([AnyHashable : Any]) -> Void, failure: ((Error) -> Void)? = nil)
  • Undocumented

    Declaration

    Objective-C

    + (void)requestMultiMeetingLiveStatusWithMainChannelId:(NSString *)mainChannelId 
                                                   success:(void (^) (NSArray *multiMeetingLiveStatusList))success
                                                   failure:(void (^ _Nullable)(NSError * error))failure;

    Swift

    class func requestMultiMeetingLiveStatus(withMainChannelId mainChannelId: String, success: @escaping ([Any]) -> Void, failure: ((Error) -> Void)? = nil)