Classes

The following classes are available globally.

  • Undocumented

    See more

    Declaration

    Objective-C

    @interface PLVCustomMessage : NSObject
    
    @property (nonatomic, copy) NSString * _Nullable msgId;
    
    @property (nonatomic, copy) NSString *tip;
    
    @property (nonatomic, copy) NSString *event;
    
    @property (nonatomic, strong) NSDictionary *data;
    
    @property (nonatomic, assign) int emitMode;
    
    @end

    Swift

    class PLVCustomMessage : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface PLVImageMessage : NSObject
    
    @property (nonatomic, copy) NSString * _Nullable msgId;
    
    @property (nonatomic, copy) NSString *imageId;
    
    @property (nonatomic, copy) NSString *imageName;
    
    @property (nonatomic, copy) NSString * _Nullable imageUrl;
    
    @property (nonatomic, strong) UIImage * _Nullable image;
    
    @property (nonatomic, assign) CGSize imageSize;
    
    @property (nonatomic, assign) float uploadProgress;
    
    @property (nonatomic, assign) PLVImageUploadState uploadState;
    
    @property (nonatomic, assign) PLVImageMessageSendState sendState;
    
    @end

    Swift

    class PLVImageMessage : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface PLVQuoteMessage : NSObject
    
    @property (nonatomic, copy) NSString * _Nullable msgId;
    
    @property (nonatomic, copy) NSString *content;
    
    @property (nonatomic, copy) NSString *quoteUserId;
    
    @property (nonatomic, copy) NSString *quoteUserName;
    
    @property (nonatomic, copy) NSString * _Nullable quoteContent;
    
    @property (nonatomic, copy) NSString * _Nullable quoteImageUrl;
    
    @property (nonatomic, assign) CGSize quoteImageSize;
    
    @end

    Swift

    class PLVQuoteMessage : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface PLVRewardMessage : NSObject
    
    /// 消息Id
    /// @note 从接口拉取不为空,从即时消息收取为nil
    @property (nonatomic, copy) NSString * _Nullable msgId;
    
    /// 打赏的用户
    @property (nonatomic, copy) NSString *unick;
    
    /// 打赏的数量
    @property (nonatomic, copy) NSString *goodNum;
    
    /// 打赏内容:礼物打赏为礼物名称,现金打赏为金额
    @property (nonatomic, copy) NSString *rewardContent;
    
    /// 礼物打赏为礼物图片,现金打赏为空, 使用本地图片
    @property (nonatomic, copy) NSString * _Nullable gimg;
    
    @end

    Swift

    class PLVRewardMessage : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface PLVSpeakMessage : NSObject
    
    @property (nonatomic, copy) NSString * _Nullable msgId;
    
    @property (nonatomic, copy) NSString *content;
    
    @end

    Swift

    class PLVSpeakMessage : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface PLVChatroomManager : NSObject
    /// 委托代理
    @property (nonatomic, weak) id<PLVChatroomManagerProtocol> delegate;
    /// 当前场次ID,需在Demo层进行设置,并监听数据变化实时更新
    @property (nonatomic, copy) NSString * _Nullable sessionId;
    /// 当前登陆用户是否是特殊身份(譬如讲师),默认为NO,为YES时字段banned永远为NO
    @property (nonatomic, assign) BOOL specialRole;
    /// socket处于已连接且登陆成功的状态时为YES,默认为NO
    @property (nonatomic, assign, readonly) BOOL online;
    /// 聊天室是否被关闭,默认为NO
    @property (nonatomic, assign, readonly) BOOL closeRoom;
    /// 当前登陆用户是否被禁言,默认为NO
    @property (nonatomic, assign, readonly) BOOL banned;
    
    /// 单例方法
    + (instancetype)sharedManager;
    
    /// 发送提问消息
    /// @param content 提问的文本内容
    /// @return 发送结果,成功为YES,失败为NO
    - (BOOL)sendQuesstionMessage:(NSString *)content;
    
    /// 发送自定义消息
    /// @param message 自定义消息数据模型
    /// @return 发送结果,成功为YES,失败为NO
    - (BOOL)sendCustonMessage:(PLVCustomMessage *)message;
    
    /// 发送文本消息,默认不需要回调msgId
    /// @param message 文本消息数据模型
    /// @return 发送结果,成功为YES,失败为NO
    - (BOOL)sendSpeakMessage:(PLVSpeakMessage *)message;
    
    /// 发送文本消息
    /// @param message 文本消息数据模型
    /// @param needIdCallback 是否需要回调msgId
    /// @return 发送结果,成功为YES,失败为NO
    - (BOOL)sendSpeakMessage:(PLVSpeakMessage *)message
              needIdCallback:(BOOL)needIdCallback;
    
    /// 发送文本消息
    /// @param message 文本消息数据模型
    /// @param replyMsgId 回复消息ID(非回复消息该字段为nil),仅在属性specialRole为YES时生效
    /// @param needIdCallback 是否需要回调msgId
    /// @return 发送结果,成功为YES,失败为NO
    - (BOOL)sendSpeakMessage:(PLVSpeakMessage *)message
                  replyMsgId:(NSString * _Nullable)replyMsgId
              needIdCallback:(BOOL)needIdCallback;
    
    /// 发送文本消息
    /// @param message 文本消息数据模型
    /// @param replyMsgId 回复消息ID(非回复消息该字段为nil),仅在属性specialRole为YES时生效
    /// @param needIdCallback 是否需要回调msgId
    /// @param callback 回调
    /// @return 发送结果,成功为YES,失败为NO
    - (BOOL)sendSpeakMessage:(PLVSpeakMessage *)message
                  replyMsgId:(NSString * _Nullable)replyMsgId
              needIdCallback:(BOOL)needIdCallback
                    callback:(void (^ _Nullable)(NSString *msgId))callback;
    
    /// 发送图片消息
    /// 发送结果通过delegate通知
    /// @param message 图片消息数据模型
    - (void)sendImageMessage:(PLVImageMessage *)message;
    
    /// 发送点赞,新增点赞次数为1
    /// 调用该方法之后,内部会进行数据累计,每5s发送一次socket消息,每30s发送一次http统计
    - (void)sendLikeEvent;
    
    /// 发送点赞
    /// 调用该方法之后,内部会进行数据累计,每5s发送一次socket消息,每30s发送一次http统计
    /// @param count 新增点赞次数
    - (void)sendLikeEvent:(NSInteger)count;
    
    /// 发送禁言消息,讲师端专用接口
    /// @param banned YES-禁言 NO-取消禁言
    /// @param userId 被禁言/取消禁言的用户ID
    - (BOOL)sendBandMessage:(BOOL)banned bannedUserId:(NSString *)userId;
    
    /// 发送踢人消息,讲师端专用接口
    /// @param userId 被踢出的用户ID
    - (BOOL)sendKickMessageWithUserId:(NSString *)userId;
    
    /// 发送全体禁言、解禁消息,讲师端专用接口
    /// @param closeRoom YES:全体禁言;NO:全体解禁
    - (BOOL)sendCloseRoom:(BOOL)closeRoom;
    
    /// 开启管理器
    /// @param delegate 用于设置代理,监听socket消息等
    - (void)setupWithDelegate:(id<PLVChatroomManagerProtocol>)delegate channelId:(NSString *)channelId;
    
    /// 退出前调用,用于资源释放、状态位清零
    - (void)destroy;
    
    @end

    Swift

    class PLVChatroomManager : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface PLVWErrorManager : NSObject
    
    /// 用来自定义错误码描述的 delegate
    /// 注意:该 delegate 是单代理,不是多代理
    @property (nonatomic, weak) NSObject<PLVWErrorManagerProtocol> *delegate;
    
    + (instancetype)sharedManager;
    
    - (NSError *)errorWithModul:(PLVFErrorCodeModul)modul code:(NSInteger)code;
    
    @end

    Swift

    class PLVWErrorManager : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface PLVInteractBaseApp : NSObject
    
    @property (nonatomic, weak) id <PLVInteractBaseAppDelegate> delegate;
    
    @property (nonatomic, weak) PLVJSBridge * jsBridge;
    
    @property (nonatomic, assign) float triviaCardTimeoutSec;   /// 互动应用提交超时秒数
    @property (nonatomic, assign) NSInteger triviaCardMaxRetryCount;/// 互动应用最大重试提交次数
    
    - (instancetype)initWithJsBridge:(PLVJSBridge *)jsBridge;
    
    - (void)processInteractMessageString:(NSString *)msgString jsonDict:(NSDictionary *)jsonDict;
    
    - (void)callRequirePortraitScreen;
    
    - (void)callWebviewShow;
    
    - (void)submitResultCallback:(NSString *)json event:(NSString *)event;
    
    - (void)submitResultTimeoutCallback:(NSString *)event;
    
    @end

    Swift

    class PLVInteractBaseApp : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface PLVInteractWebview : NSObject
    
    @property (nonatomic, weak) id <PLVInteractWebviewDelegate> delegate;
    
    @property (nonatomic, strong, readonly) PLVJSBridge * jsBridge;
    
    @property (nonatomic, strong, readonly) WKWebView * webview;
    
    @end

    Swift

    class PLVInteractWebview : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface PLVWebViewBridge : NSObject
    
    @property (nonatomic, weak) id<PLVWebViewBridgeProtocol> delegate;
    
    + (instancetype)bridgeWithWebview:(WKWebView *)webView webviewDelegate:(id<WKNavigationDelegate>)webViewDelegate;
    
    + (instancetype)bridgeWithWebview:(WKWebView *)webView;
    
    - (void)setWebViewDelegate:(id<WKNavigationDelegate> __nullable)webViewDelegate;
    
    #pragma mark - Call JS Method
    
    /// 设置用户信息
    /// @param userDict  socket 用户登录信息
    - (void)setUserInfo:(NSDictionary *)userDict;
    
    #pragma mark 观看专用方法
    
    /// 刷新PPT内容
    /// @param jsonObject PPT内容
    /// @param delay 延迟时间 (单位毫秒)
    - (void)refreshPPTWithJsonObject:(NSDictionary *)jsonObject delay:(NSUInteger)delay;
    
    /// 设置视频SEI信息
    /// @param newTimeStamp 时间戳信息
    - (void)setSEIData:(long)newTimeStamp;
    
    /// 加载回放PPT
    /// @param vid 回放视频的vid
    - (void)pptStartWithVid:(NSString *)vid;
    
    #pragma mark 推流专用方法
    
    /// 设置或取消画笔权限
    /// @param userType  用户权限, speaker 代表控制ppt权限+画笔权限
    - (void)setPaintPermission:(NSString *)userType;
    
    /// 设置画板是否处于可绘制状态
    /// @param open  打开或关闭画板
    - (void)setPaintStatus:(BOOL)open;
    
    /// 告诉 h5 现在开始上课,h5 会清空画板
    /// @param jsonDict 开始推流时发送的 socket 消息
    - (void)setSliceStart:(id)jsonDict;
    
    /// 切换 ppt 或白板
    /// 如果切换的是文档,切换成功后触发回调 '-jsbridge_documentChangeWithAutoId:imageUrls:'
    /// @param autoId  切换的文档的 autoId,如果是白板 autoId 为 0
    /// @param pageNumber  切换到文档的第几页,-1 表示打开上次展示的页面
    - (void)changePPTWithAutoId:(NSUInteger)autoId pageNumber:(NSInteger)pageNumber;
    
    /// 设置画笔类型
    /// @param type  line - 自由笔;text - 文字;arrowLine - 箭头
    - (void)setDrawType:(PLVWebViewBrushPenType)type;
    
    /// 修改画笔颜色
    /// @param hexString  RGB色值,如红色为“#FF0000”
    - (void)changeColor:(NSString *)hexString;
    
    /// 进入画笔删除状态
    - (void)toDelete;
    
    /// 删除所有画笔
    - (void)deleteAllPaint;
    
    /// 完成文本输入
    - (void)changeTextContent:(NSString *)content;
    
    #pragma mark - Register JS Method
    
    /// 注册 'sendSocketEvent' 方法
    /// 用于把 h5 接收到的操作画板产生的数据,通过 socket 发送给聊天室
    /// 用于开播场景时,开始推流才需要发送 h5 画板数据到聊天室
    /// 配合回调 '-jsbridge_sendSocketEventWithJson:' 使用
    - (void)registerSocketEventFunction;
    
    #pragma mark 观看专用方法
    
    /// 注册 'pptPrepare' 方法
    /// 【回放时】用于PPT视图准备完毕时接收到通知
    /// 配合回调 '-jsbridge_PPTHadPrepare' 使用
    - (void)registerPPTPrepareFunction;
    
    /// 注册 'videoDuration' 方法
    /// 用于PPT视图需要获取视频回放播放器当前播放时间点时接收到通知
    /// 配合回调 '-jsbridge_getCurrentPlaybackTime' 使用
    - (void)registerVideoDurationFunction;
    
    /// 注册 'changePPTPosition' 方法
    /// 用于讲师发起PPT位置切换时接收到通知
    /// 配合回调 '-jsbridge_changePPTPosition:' 使用 
    - (void)registerChangePPTPositionFunction;
    
    #pragma mark 推流专用方法
    
    /// 注册 'pptStatusChange' 方法
    /// 用于文档翻页时接收到通知
    /// 配合回调 '-jsbridge_pageStatusChangeWithAutoId:pageNumber:totalPage:pptStep:' 使用
    - (void)registerPPTStatusChangeFunction;
    
    /// 注册 'toEditText' 方法
    /// 用于 webView 上准备输入文字时调用
    /// 配合回调 '-jsbridge_documentInputWithText:textColor:' 使用
    - (void)registerPPTInputFunction;
    
    /// 注册 'whiteImages' 方法
    /// 用于 webView 上白板预览图更新时调用
    /// 配合回调 '-jsbridge_updateWhiteboardImageData:pageNumber:' 使用
    - (void)registerWhiteImagesFunction;
    
    @end

    Swift

    class PLVWebViewBridge : NSObject
  • 控制台Log打印

    Note

    控制台Log等级打印、全局开关在此类中实现。
    See more

    Declaration

    Objective-C

    @interface PLVConsoleLogger

    Swift

    class PLVConsoleLogger
  • ViewLog 统计后台用户自定义参数

    See more

    Declaration

    Objective-C

    @interface PLVViewLogCustomParam : NSObject

    Swift

    class PLVViewLogCustomParam : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface PLVWLogReporterManager : NSObject
    
    + (instancetype)sharedManager;
    
    #pragma mark - ELog
    
    /**
     Elog 上报器初始化接口 1
     云课堂直播间登录时调用
     */
    - (void)registerReporterWithChannelId:(NSString *)channelId
                                    appId:(NSString *)appId
                                appSecret:(NSString *)appSecret
                                   userId:(NSString *)userId;
    
    /**
     Elog 上报器初始化接口 2
     云课堂回放登录时调用
     */
    - (void)registerReporterWithChannelId:(NSString *)channelId
                                    appId:(NSString *)appId
                                appSecret:(NSString *)appSecret
                                   userId:(NSString *)userId
                                      vId:(NSString *)vId;
    
    /**
     Elog 上报器登录信息清除接口
     云课堂直播/回放退出登录时调用
     */
    - (void)clear;
    
    /**
    Elog 上报器错误日志上报接口 1
    */
    - (void)reportWithErrorCode:(NSInteger)errorCode
                    information:(id __nullable)information;
    
    /**
     Elog 事件上报便利接口 1
     */
    - (void)reportWithEvent:(NSString *)event
                      modul:(NSString *)modul
            informationType:(NSString * __nullable)type
            informationData:(id __nullable)data;
    
    /**
    Elog 事件上报便利接口 2
    */
    - (void)reportWithEvent:(NSString *)event
                      modul:(NSString *)modul
                information:(id __nullable)information;
    
    /**
    Elog 事件上报便利接口 1 - 批量上报
    */
    - (void)reportWithEvent:(NSString *)event
                      modul:(NSString *)modul
            informationType:(NSString * __nullable)type
            informationData:(id __nullable)data
                      patch:(BOOL)patch;
    
    /**
    Elog 事件上报便利接口 2 - 批量上报
    */
    - (void)reportWithEvent:(NSString *)event
                      modul:(NSString *)modul
                information:(id __nullable)information
                      patch:(BOOL)patch;
    
    #pragma mark - View Log
    
    /**
    直播播放信息统计:用于直播、回放时
    @param param 统计后台用户自定义参数配置类
    @param playerId 播放器ID
    */
    - (void)reportLiveViewLogWithParam:(PLVViewLogCustomParam *)param
                              playerId:(NSString *)playerId
                   logModelConfigBlock:(PLVFViewLogModel *(^)(void))configBlock;
    
    /**
    点播播放信息统计:用于播放点播视频时
     @param param 统计后台用户自定义参数配置类
     @param playerId 播放器ID
    */
    - (void)reportVodViewLogWithParam:(PLVViewLogCustomParam *)param
                             playerId:(NSString *)playerId
                  logModelConfigBlock:(PLVFViewLogModel *(^)(void))configBlock;
    
    #pragma mark - Qos
    
    /**
    服务质量统计
    */
    /**
    直播首次加载时长
    @param channel 频道信息
    @param time 首次加载时长
    @param playerId 播放器ID
    */
    - (void)reportLiveLoadingQosWithChannel:(PLVChannelInfoModel *)channel
                                       time:(int)time
                                   playerId:(NSString *)playerId;
    
    /**
    回放首次加载时长
    @param channel 频道信息
    @param time 首次加载时长
    @param playerId 播放器ID
    @param vid 视频vid
    */
    - (void)reportVodLoadingQosWithChannel:(PLVChannelInfoModel *)channel
                                      time:(int)time
                                  playerId:(NSString *)playerId
                                       vid:(NSString *)vid;
    
    /**
     直播二次缓冲时长
     @param channel 频道信息
     @param time 二次缓冲时长
     @param playerId 播放器ID
     */
    - (void)reportLiveBufferQosWithChannel:(PLVChannelInfoModel *)channel
                                      time:(int)time
                                  playerId:(NSString *)playerId;
    
    /**
     回放二次缓冲时长
     @param channel 频道信息
     @param time 二次缓冲时长
     @param playerId 播放器ID
     @param vid 视频vid
     */
    - (void)reportVodBufferQosWithChannel:(PLVChannelInfoModel *)channel
                                     time:(int)time
                                 playerId:(NSString *)playerId
                                      vid:(NSString *)vid;
    
    /**
     直播播放出错
    @param channel 频道信息
    @param uri 请求资源的URI
    @param status 服务器响应的状态码
    @param errorcode 错误代码
    @param errormsg 错误内容描述
    @param playerId 播放器ID
    */
    - (void)reportLiveErrorQosWithChannel:(PLVChannelInfoModel *)channel
                                      uri:(NSString *)uri
                                   status:(NSString *)status
                                errorcode:(NSString *)errorcode
                                 errormsg:(NSString *)errormsg
                                 playerId:(NSString *)playerId;
    
    /**
     回放播放出错
    @param channel 频道信息
    @param uri 请求资源的URI
    @param status 服务器响应的状态码
    @param errorcode 错误代码
    @param errormsg 错误内容描述
    @param playerId 播放器ID
    @param vid 视频vid
    */
    - (void)reportVodErrorQosWithChannel:(PLVChannelInfoModel *)channel
                                     uri:(NSString *)uri
                                  status:(NSString *)status
                               errorcode:(NSString *)errorcode
                                errormsg:(NSString *)errormsg
                                playerId:(NSString *)playerId
                                     vid:(NSString *)vid;
    
    @end

    Swift

    class PLVWLogReporterManager : NSObject
  • Undocumented

    See more

    Declaration

    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;
    
    /**
     直播登录校验 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;
    
    /**
     回放登录校验 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;
    
    /// 推流登陆,获取推流的频道信息
    /// @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;
    
    /**
     登录界面,校验后,根据vodId获取该频道的类型(普通直播,云课堂)
     
     @param vodId 回放视频ID
     */
    + (void)getVodType:(NSString *)vodId completion:(void (^)(PLVChannelType channelType))completion failure:(void (^)(NSError *error))failure;
    
    /**
     获取频道菜单列表
     
     @param channelId 频道号
     */
    + (void)getChannelMenuInfos:(NSUInteger)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 获取 文档列表数据
     
     @param channelId 频道号
     */
    + (void)requestDocumentListWithChannelId:(NSString *)channelId completion:(void (^)(NSArray<NSDictionary *> *responseArray))completion failure:(void (^)(NSError *error))failure;
    
    /**
      根据频道号 channelId、文件ID fileId 删除某个文档
     
     @param channelId 频道号
     @param fileId 文件ID
     */
    + (void)deleteDocumentWithChannelId:(NSString *)channelId fileId:(NSString *)fileId completion:(void (^)(void))completion failure:(void (^)(NSError *error))failure;
    
    /**
      获取 PPT 文档转码结果
     
     @param channelId 频道号
     @param fileId 文件ID
     */ 
    + (void)getDocumentConvertStatusWithChannelId:(NSString *)channelId fileId:(NSString *)fileId completion:(void (^)(NSArray <NSDictionary *> *responseArray))completion failure:(void (^)(NSError *error))failure;
    
    #pragma mark - 聊天室相关
    
    /**
     获取 chatToken
    
     @param channelId 频道号
     @param userId 聊天室用户ID
     @param role 聊天室用户角色
     */
    + (void)getChatTokenWithChannelId:(NSInteger)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:(NSInteger)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 startIndex 开始index
     @param endIndex 结束index
     */
    + (void)requestChatRoomHistoryWithRoomId:(NSUInteger)roomId startIndex:(NSUInteger)startIndex endIndex:(NSInteger)endIndex completion:(void (^)(NSArray *historyList))completion failure:(void (^)(NSError *error))failure;
    
    /**
     获取聊天室在线人数列表接口
     
     @param roomId 频道号/房间号
     @param page 页码
     @param length 一页的数据条数
     */
    + (void)requestChatRoomListUsersWithRoomId:(NSUInteger)roomId
                                          page:(NSUInteger)page
                                        length:(NSUInteger)length
                                      streamer:(BOOL)streamer
                                       success:(void (^)(NSDictionary *data))success
                                       failure:(void (^ _Nullable)(NSError *error))failure;
    
    /**
     点赞
     
     @param channelId 频道号
     @param viewerId 聊天室用户Id
     @param times 某段时间内(30秒内)的总点赞数
     */
    + (void)likeWithChannelId:(NSUInteger)channelId viewerId:(NSString *)viewerId times:(NSUInteger)times completion:(void (^)(void))completion failure:(void (^ _Nullable )(NSError *error))failure;
    
    /**
     发送图片
     
     @param image 图片
     @param imageName 图片名字
     */
    + (void)uploadImage:(UIImage *)image imageName:(NSString *)imageName channelId:(NSString *)channelId progress:(void (^)(float))progressBlock success:(void (^_Nonnull)(NSDictionary * _Nonnull, NSString * _Nonnull, NSString * _Nonnull))successBlock fail:(void (^_Nonnull)(NSError * _Nonnull))failBlock;
    
    /**
     增加播放热度
     
     @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;
    
    #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:(NSUInteger)roomId sessionId:(NSString *)sessionId 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;
    
    #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;
    
    /**
      获取账号积分打赏设置
      
      @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;
    
    #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 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 *model, NSError *error))completion;
    
    #pragma mark - 跑马灯
    
    /**
     加载自定义跑马灯
    
     @param url 自定义跑马灯地址
     @param channelId 直播频道号
     @param userId 云直播账号 用户ID
     @param completion 加载成功
     @param failure 加载失败
     */
    + (void)loadCustomMarquee:(NSURL *)url withChannelId:(NSUInteger)channelId userId:(NSString *)userId
                   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 stream 流名
    /// @param success 请求成功
    /// @param failure 请求失败
    + (void)requestChannelLivestatusEndWithChannelId:(NSString *)channelId stream:(NSString *)stream success:(void (^)(NSString *))success failure:(void (^)(NSError * error))failure;
    
    @end

    Swift

    class PLVLiveVideoAPI : NSObject
  • 频道信息数据模型

    See more

    Declaration

    Objective-C

    @interface PLVChannelInfoModel : NSObject

    Swift

    class PLVChannelInfoModel : NSObject
  • 商品数据模型

    See more

    Declaration

    Objective-C

    @interface PLVCommodityModel : NSObject

    Swift

    class PLVCommodityModel : NSObject
  • tab子菜单信息

    See more

    Declaration

    Objective-C

    @interface PLVLiveVideoChannelMenu

    Swift

    class PLVLiveVideoChannelMenu
  • 频道菜单信息

    See more

    Declaration

    Objective-C

    @interface PLVLiveVideoChannelMenuInfo

    Swift

    class PLVLiveVideoChannelMenuInfo
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface PLVPlaybackVideoModel : PLVSafeModel
    
    /// 是否为默认播放视频,值为Y/N
    @property (nonatomic, copy) NSString *asDefault;
    /// 回放视频对应的直播频道id
    @property (nonatomic, copy) NSString *channelId;
    /// 用于PPT请求数据,与PPT直播的回放相关,普通直播回放值为null
    @property (nonatomic, copy) NSString *channelSessionId;
    /// 视频长度
    @property (nonatomic, copy) NSString *duration;
    /// 视频首图
    @property (nonatomic, copy) NSString *firstImage;
    /// 视频合并信息,后续补充
    @property (nonatomic, copy) NSString *mergeinfo;
    /// 默认视频的播放清晰度,1为流畅,2为高清,3为超清
    @property (nonatomic, copy) NSString *myBr;
    /// 访客信息收集id
    @property (nonatomic, copy) NSString *qid;
    /// 视频加密状态,1表示为加密状态,0为非加密
    @property (nonatomic, assign) long seed;
    /// 直播开始时间
    @property (nonatomic, copy) NSString *startTime;
    /// 视频标题
    @property (nonatomic, copy) NSString *title;
    /// 视频播放地址,注:如果视频为加密视频,则此地址无法访问
    @property (nonatomic, copy) NSString *url;
    /// 点播后台用户id
    @property (nonatomic, copy) NSString *userId;
    /// 直播系统生成的id
    @property (nonatomic, copy) NSString *videoId;
    /// 点播视频vid
    @property (nonatomic, copy) NSString *videoPoolId;
    /// 直播类型
    @property (nonatomic, copy) NSString *liveType;
    /// 添加为回放视频的日期
    @property (nonatomic, copy) NSString *createdTime;
    /// 视频最后修改日期
    @property (nonatomic, copy) NSString *lastModified;
    
    @end

    Swift

    class PLVPlaybackVideoModel
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface PLVPlaybackListModel : PLVSafeModel
    
    /// 回放视频总个数
    @property (nonatomic, assign) long totalItems;
    /// 总页数
    @property (nonatomic, assign) long totalPages;
    /// 当前页第一个视频在回放视频中的位置
    @property (nonatomic, assign) long startRow;
    /// 当前页最后一个视频在回放视频中的位置
    @property (nonatomic, assign) long endRow;
    /// 是否为第一页,值为:true/false
    @property (nonatomic, assign) BOOL firstPage;
    /// 是否为最后一页,值为:true/false
    @property (nonatomic, assign) BOOL lastPage;
    /// 上一页编号
    @property (nonatomic, assign) long prePageNumber;
    /// 下一页编号
    @property (nonatomic, assign) long nextPageNumber;
    /// 当前页视频个数
    @property (nonatomic, assign) long limit;
    /// 视频列表页数(默认以12条数据为1页)
    @property (nonatomic, assign) long pageNumber;
    
    /// 视频列表
    @property (nonatomic, copy) NSArray<PLVPlaybackVideoModel *> *contents;
    
    @end

    Swift

    class PLVPlaybackListModel
  • PPT视图

    Note

    直播,添加至相应视图中即可; 回放,添加至相应视图中,并调用 [pptStart] 方法即可;
    // 直播场景 代码演示
    // 1.创建及加载
    PLVPPTWebview * pptWebiew = [[PLVPPTWebview alloc] init];
    [someView addSubview:pptWebiew];
    pptWebiew.frame = someView.bounds;
    [pptWebiew loadOnlinePPT];
    
    // 2. socket 登录成功后设置用户信息
    pptWebiew.userInfo = userInfo;
    
    // 3. 接收到 socket PPT事件则执行刷新
    [pptWebiew refreshPPT:json];
    
    See more

    Declaration

    Objective-C

    @interface PLVPPTWebview

    Swift

    class PLVPPTWebview
  • 裸播放器

    Note

    支持直接使用 URL 进行播放;此类不具备业务逻辑,也不依赖其他业务类;
    See more

    Declaration

    Objective-C

    @interface PLVPlayer : NSObject

    Swift

    class PLVPlayer : NSObject
  • 直播回放播放器

    Note

    直播回放播放器 继承自 PLVPlayer.h; 若您希望了解 播放器基础功能 相关属性方法,可查看 PLVPlayer.h; 若您希望了解 直播回放业务 相关属性方法,可查看 PLVLivePlaybackPlayer.h;
    // 使用演示
    PLVLivePlaybackPlayer * livePlaybackPlayer = [[PLVLivePlaybackPlayer alloc] initWithPolyvAccountUserId:accountUserId channelId:channelId vodId:vodId vodList:NO];
    livePlaybackPlayer.delegate = self;
    livePlaybackPlayer.livePlaybackDelegate = self;
    [livePlaybackPlayer setupDisplaySuperview:displaySuperview];
    
    See more

    Declaration

    Objective-C

    @interface PLVLivePlaybackPlayer : PLVPlayer

    Swift

    class PLVLivePlaybackPlayer : PLVPlayer
  • 直播播放器

    Note

    若您希望了解 播放器基础功能 相关属性方法,可查看父类 PLVPlayer.h; 若您希望了解 直播业务 相关属性方法,可查看 PLVLivePlayer.h;
    // 使用演示
    PLVLivePlayer * livePlayer = [[PLVLivePlayer alloc] initWithPolyvAccountUserId:accountUserId channelId:channelId];
    livePlayer.delegate = self;
    livePlayer.liveDelegate = self;
    [livePlayer setupDisplaySuperview:displaySuperview];
    
    See more

    Declaration

    Objective-C

    @interface PLVLivePlayer : PLVPlayer

    Swift

    class PLVLivePlayer : PLVPlayer
  • 直播 SDK 配置文件

    See more

    Declaration

    Objective-C

    @interface PLVLiveVideoConfig : NSObject

    Swift

    class PLVLiveVideoConfig : NSObject
  • 更新连麦Token时所需的数据模型

    See more

    Declaration

    Objective-C

    @interface PLVLinkMicGetTokenModel : NSObject

    Swift

    class PLVLinkMicGetTokenModel : NSObject
  • 连麦管理器

    See more

    Declaration

    Objective-C

    @interface PLVLinkMicManager : NSObject

    Swift

    class PLVLinkMicManager : NSObject
  • RTC 推流管理器

    See more

    Declaration

    Objective-C

    @interface PLVRTCStreamerManager : NSObject

    Swift

    class PLVRTCStreamerManager : NSObject
  • 混流用户模型

    See more

    Declaration

    Objective-C

    @interface PLVRTCStreamerMixUser : NSObject

    Swift

    class PLVRTCStreamerMixUser : NSObject
  • socket 管理类

    See more

    Declaration

    Objective-C

    @interface PLVSocketManager : NSObject

    Swift

    class PLVSocketManager : NSObject
  • 文档上传数据模型

    See more

    Declaration

    Objective-C

    @interface PLVDocumentUploadModel : NSObject

    Swift

    class PLVDocumentUploadModel : NSObject
  • 文档上传管理器

    See more

    Declaration

    Objective-C

    @interface PLVDocumentUploadClient : NSObject

    Swift

    class PLVDocumentUploadClient : NSObject