Protocols

The following protocols are available globally.

  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol PLVChatroomManagerProtocol <NSObject>
    
    @optional
    
    /// 发送消息包含严禁词时触发
    /// @param message 后端返回的message提示文本
    /// @param word 触发的严禁词
    /// @note 该回调会在全局队列中执行
    - (void)chatroomManager_receiveWarning:(NSString *)message prohibitWord:(NSString *)word;
    
    /// 发送图片违规时触发
    /// @param msgId 后端返回的消息ID
    /// @note 该回调会在全局队列中执行
    - (void)chatroomManager_receiveImageWarningWithMsgId:(NSString *)msgId;
    
    
    /// 发送图片失败时触发
    /// @param message 图片消息数据模型
    - (void)chatroomManager_sendImageMessageFaild:(PLVImageMessage *)message;
    
    /// 发送图片成功时(收到socket消息回调)触发
    /// @param message 图片消息数据模型(已更新了数据模型中的msgId字段)
    - (void)chatroomManager_sendImageMessageSuccess:(PLVImageMessage *)message;
    
    /// 图片消息中的图片上传进度发生变化时触发
    /// @param message 图片消息模型
    /// @param progress 图片上传进度(大于0小于等于1)
    - (void)chatroomManager_sendImageMessage:(PLVImageMessage *)message updateProgress:(CGFloat)progress;
    
    @end

    Swift

    protocol PLVChatroomManagerProtocol : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol PLVWErrorManagerProtocol <NSObject>
    
    @optional
    
    - (NSString *)customLocalizedDescriptionWithModul:(PLVFErrorCodeModul)modul code:(NSInteger)code;
    
    - (NSString *)customHelpAnchorErrorWithModul:(PLVFErrorCodeModul)modul code:(NSInteger)code;
    
    @end

    Swift

    protocol PLVWErrorManagerProtocol : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol PLVInteractBaseAppDelegate <NSObject>
    
    - (void)plvInteractAppRequirePortraitScreen:(PLVInteractBaseApp *)interactApp;
    
    - (void)plvInteractApp:(PLVInteractBaseApp *)interactApp webviewShow:(BOOL)show;
    
    @end

    Swift

    protocol PLVInteractBaseAppDelegate : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol PLVInteractWebviewDelegate <NSObject>
    
    - (void)plvInteractWebview:(PLVInteractWebview *)interactWebview
    didReceiveInteractMessageString:(NSString *)msgString
                      jsonDict:(NSDictionary *)jsonDict;
    
    @end

    Swift

    protocol PLVInteractWebviewDelegate : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol PLVWebViewBridgeProtocol <NSObject>
    
    @optional
    
    #pragma mark 通用回调
    
    /// webView 需要发送消息给 socket 时调用
    - (void)jsbridge_sendSocketEventWithJson:(id)jsonObject;
    
    #pragma mark 观看场景回调
    
    /// webView 上PPT视图准备完毕时调用
    - (void)jsbridge_PPTHadPrepare;
    
    /// [回放场景] PPT视图 需要获取视频播放器的当前播放时间点
    /// @return NSTimeInterval 当前播放时间点
    - (NSTimeInterval)jsbridge_getCurrentPlaybackTime;
    
    /// [回放场景] PPT视图 讲师发起PPT位置切换
    /// @note 回放中,将复现讲师对PPT的位置操作。收到此回调时,外部应根据 status 值相应切换PPT视图位置
    /// @param status PPT是否需要切换至主窗口 (YES-PPT需要切至主窗口 NO-PPT需要切至小窗,视频需要切至主窗口)
    - (void)jsbridge_changePPTPosition:(BOOL)status;
    
    #pragma mark 推流场景回调
    
    /// webView 上的文档切换时调用
    - (void)jsbridge_documentChangeWithAutoId:(NSUInteger)autoId imageUrls:(NSArray *)imageUrls;
    
    /// webView 上的文档翻页时调用
    - (void)jsbridge_pageStatusChangeWithAutoId:(NSUInteger)autoId pageNumber:(NSUInteger)pageNumber totalPage:(NSUInteger)totalPage pptStep:(NSUInteger)step;
    
    /// webView 上准备输入文字时调用
    - (void)jsbridge_documentInputWithText:(NSString *)inputText textColor:(NSString *)textColor;
    
    /// webView 上白板预览图更新时调用
    - (void)jsbridge_updateWhiteboardImageData:(NSData *)imageData pageNumber:(NSUInteger)pageNumber;
    
    @end

    Swift

    protocol PLVWebViewBridgeProtocol : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol PLVPPTWebviewDelegate <NSObject>
    
    @optional
    
    #pragma mark - 通用回调
    /// PPT视图 已准备完毕
    ///
    /// @param pptWebview PPT视图对象
    - (void)plvPPTWebviewHadPrepared:(PLVPPTWebview *)pptWebview;
    
    
    #pragma mark - 直播场景回调
    /// [直播场景] PPT视图 发送笔触数据
    ///
    /// @note 开启画笔权限的连麦学员,在操作绘画后,需将生成的笔触数据,回调给外部处理;
    ///
    /// @param pptWebview PPT视图对象
    /// @param jsonData PPT视图对象
    - (void)plvPPTWebview:(PLVPPTWebview *)pptWebview sendPaintInfo:(NSString *)jsonData;
    
    
    #pragma mark - 回放场景回调
    /// [回放场景] PPT视图 需要获取视频播放器的当前播放时间点
    ///
    /// @param pptWebview PPT视图对象
    ///
    /// @return NSTimeInterval 当前播放时间点
    - (NSTimeInterval)plvPPTWebviewGetPlayerCurrentTime:(PLVPPTWebview *)pptWebview;
    
    /// [回放场景] PPT视图 讲师发起PPT位置切换
    ///
    /// @note 回放中,将复现讲师对PPT的位置操作。收到此回调时,外部应根据 status 值相应切换PPT视图位置
    ///
    /// @param pptWebview PPT视图对象
    /// @param status PPT是否需要切换至主窗口 (YES:PPT需要切至主窗口 NO:PPT需要切至小窗,视频需要切至主窗口)
    - (void)plvPPTWebview:(PLVPPTWebview *)pptWebview changePPTPosition:(BOOL)status;
    
    @end

    Swift

    protocol PLVPPTWebviewDelegate
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol PLVPlayerDelegate <NSObject>
    
    @optional
    /// 播放器加载前,回调options配置对象
    ///
    /// @note 播放器在加载前,将触发此回调,并附带 PLVOptions,有自定义配置需求时,可对此对象进行参数设置。
    ///       当集成的是 PolyvIJKMediaFramework 时,请按 PLVIJKFFOptions 来处理 options;
    ///       当集成的是 IJKMediaFramework 时,请按 IJKFFOptions 来处理 options;
    ///
    /// @param player 播放器对象
    /// @param options 播放配置对象
    - (PLVOptions *)plvPlayer:(PLVPlayer *)player playerWillLoad:(PLVPlayerMainSubType)mainSubType withOptions:(PLVOptions *)options;
    
    /// 播放器 已准备好播放
    ///
    /// @param player 播放器对象
    /// @param mainSubType 播放器主副类型
    - (void)plvPlayer:(PLVPlayer *)player playerIsPreparedToPlay:(PLVPlayerMainSubType)mainSubType;
    
    /// 播放器 ’加载状态‘ 发生改变
    ///
    /// @param player 播放器对象
    /// @param mainSubType 播放器主副类型
    - (void)plvPlayer:(PLVPlayer *)player playerLoadStateDidChange:(PLVPlayerMainSubType)mainSubType;
    
    /// 播放器 ’播放状态‘ 发生改变
    ///
    /// @param player 播放器对象
    /// @param mainSubType 播放器主副类型
    - (void)plvPlayer:(PLVPlayer *)player playerPlaybackStateDidChange:(PLVPlayerMainSubType)mainSubType;
    
    /// 播放器 ’是否正在播放中‘状态 发生改变
    ///
    /// @param player 播放器对象
    /// @param mainSubType 播放器主副类型
    /// @param playing 当前是否正在播放
    - (void)plvPlayer:(PLVPlayer *)player playerPlayingStateDidChange:(PLVPlayerMainSubType)mainSubType playing:(BOOL)playing;
    
    /// 播放器 播放结束
    ///
    /// @param player 播放器对象
    /// @param mainSubType 播放器主副类型
    /// @param finishReson 播放结束原因
    - (void)plvPlayer:(PLVPlayer *)player playerPlaybackDidFinish:(PLVPlayerMainSubType)mainSubType finishReson:(IJKMPMovieFinishReason)finishReson;
    
    /// 播放器 已销毁
    ///
    /// @param player 播放器对象
    /// @param mainSubType 播放器主副类型
    - (void)plvPlayer:(PLVPlayer *)player playerDidDestroyed:(PLVPlayerMainSubType)mainSubType;
    
    /// 主播放器 ‘SEI信息’ 发生改变
    ///
    /// @param player 播放器对象
    /// @param timeStamp 附带的时间戳信息
    - (void)plvPlayer:(PLVPlayer *)player playerSeiDidChanged:(long)timeStamp;
    
    @end

    Swift

    protocol PLVPlayerDelegate : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol PLVLivePlaybackPlayerDelegate <NSObject>
    
    @optional
    /// 直播回放播放器 发生错误
    ///
    /// @param livePlaybackPlayer 直播回放播放器
    /// @param error 错误信息对象 (可能为nil;error.code 可详见 PLVFPlayErrorCodeGenerator.h)
    - (void)plvLivePlaybackPlayer:(PLVLivePlaybackPlayer *)livePlaybackPlayer loadMainPlayerFailureWithError:(NSError * _Nullable)error;
    
    /// 直播回放播放器 定时返回当前播放进度
    ///
    /// @param livePlaybackPlayer 直播回放播放器
    /// @param downloadProgress 已缓存进度 (0.0 ~ 1.0)
    /// @param playedProgress 已播放进度 (0.0 ~ 1.0)
    /// @param playedTimeString 当前播放时间点字符串 (示例 "01:23")
    /// @param durationTimeString 总时长字符串 (示例 "01:23")
    - (void)plvLivePlaybackPlayer:(PLVLivePlaybackPlayer *)livePlaybackPlayer downloadProgress:(CGFloat)downloadProgress playedProgress:(CGFloat)playedProgress playedTimeString:(NSString *)playedTimeString durationTimeString:(NSString *)durationTimeString;
    
    /// 直播回放播放器 ‘频道信息’ 发生改变
    ///
    /// @param livePlaybackPlayer 直播回放播放器
    /// @param channelInfo 当前最新 ’频道信息‘ 对象
    - (void)plvLivePlaybackPlayer:(PLVLivePlaybackPlayer *)livePlaybackPlayer channelInfoDidUpdated:(PLVChannelInfoModel *)channelInfo;
    
    @end

    Swift

    protocol PLVLivePlaybackPlayerDelegate : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol PLVLivePlayerDelegate <NSObject>
    
    @optional
    /// 直播播放器 ‘加载状态’ 发生改变
    ///
    /// @param livePlayer 直播播放器
    /// @param loadState 当前加载状态
    - (void)plvLivePlayer:(PLVLivePlayer *)livePlayer loadStateDidChanged:(PLVLivePlayerLoadState)loadState;
    
    /// 直播播放器 ‘流状态’ 更新
    ///
    /// @param livePlayer 直播播放器
    /// @param newestStreamState 当前最新的 ’流状态’
    /// @param streamStateDidChanged ’流状态‘ 相对上一次 是否发生变化
    - (void)plvLivePlayer:(PLVLivePlayer *)livePlayer streamStateUpdate:(PLVChannelLiveStreamState)newestStreamState streamStateDidChanged:(BOOL)streamStateDidChanged;
    
    /// 直播播放器 发生错误
    ///
    /// @param livePlayer 直播播放器
    /// @param error 错误信息对象 (可能为nil;error.code 可详见 PLVFPlayErrorCodeGenerator.h)
    - (void)plvLivePlayer:(PLVLivePlayer *)livePlayer loadMainPlayerFailureWithError:(NSError * _Nullable)error;
    
    /// 直播播放器 ‘频道信息’ 发生改变
    ///
    /// @param livePlayer 直播播放器
    /// @param channelInfo 当前最新 ’频道信息‘ 对象
    - (void)plvLivePlayer:(PLVLivePlayer *)livePlayer channelInfoDidUpdated:(PLVChannelInfoModel *)channelInfo;
    
    /// 直播播放器 ‘码率可选项、当前码率、线路可选数、当前线路‘ 更新
    ///
    /// @note 此回调触发时,可同时在 [channelInfo] 属性中,读取出 ‘码率信息、线路信息’ 的最新值;
    ///       调用 [switchToLineIndex:codeRate:] 切换 ’当前线路‘ 或 ’当前码率‘,会触发此回调;
    ///       [channelInfo] 刷新时,也会触发此回调,用于告知当前 ‘码率信息、线路信息’ 的最新值;
    /// 
    /// @param livePlayer 直播播放器
    /// @param codeRateOptions 码率/清晰度 可选项字符串数组
    /// @param currentCodeRate 当前 码率/清晰度
    /// @param lineNum 线路可选数
    /// @param currentLineIndex 当前线路下标 (由 0 起始)
    - (void)plvLivePlayer:(PLVLivePlayer *)livePlayer codeRateOptions:(NSArray <NSString *> *)codeRateOptions currentCodeRate:(NSString *)currentCodeRate lineNum:(NSInteger)lineNum currentLineIndex:(NSInteger)currentLineIndex;
    
    /// 直播播放器 需获知外部 ‘当前是否正在连麦’
    ///
    /// @note 此回调不保证在主线程触发
    ///
    /// @param livePlayer 直播播放器
    ///
    /// @return BOOL 需返回 ‘当前外部是否正在连麦’ 的状态布尔值
    - (BOOL)plvLivePlayerGetInLinkMic:(PLVLivePlayer *)livePlayer;
    
    /// 直播播放器 需展示暖场图片
    ///
    /// @param livePlayer 直播播放器
    /// @param show 是否展示 (YES:展示 NO:隐藏)
    /// @param warmUpImageURLString 暖场图片链接地址
    - (void)plvLivePlayer:(PLVLivePlayer *)livePlayer showWarmUpImage:(BOOL)show warmUpImageURLString:(NSString * _Nullable)warmUpImageURLString;
    
    @end

    Swift

    protocol PLVLivePlayerDelegate : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol PLVLinkMicManagerDelegate <NSObject>
    
    @optional
    
    #pragma mark 本地用户(自己)事件回调
    /// 本地用户 加入RTC频道回调
    ///
    /// @param manager 连麦管理器
    /// @param channelID 加入频道ID
    /// @param uid 当前加入RTC用户的RTCId
    - (void)plvLinkMicManager:(PLVLinkMicManager * _Nonnull)manager joinRTCChannelComplete:(NSString * _Nonnull)channelID uid:(NSString *)uid;
    
    /// 本地用户 退出RTC频道回调
    ///
    /// @param manager 连麦管理器
    /// @param channelID 退出频道ID
    - (void)plvLinkMicManager:(PLVLinkMicManager * _Nonnull)manager leaveRTCChannelComplete:(NSString * _Nonnull)channelID;
    
    /// 本地用户 连麦错误发生回调
    ///
    /// @note 若自动退出RTC频道,则会触发 [leaveRTCChannelComplete:] 回调
    ///
    /// @param manager 连麦管理器
    /// @param errorCode 错误码
    - (void)plvLinkMicManager:(PLVLinkMicManager * _Nonnull)manager didOccurError:(NSInteger)errorCode;
    
    #pragma mark 远端用户(别人)事件回调
    /// 远端用户 加入RTC频道回调
    ///
    /// @param manager 连麦管理器
    /// @param uid 远端用户id
    - (void)plvLinkMicManager:(PLVLinkMicManager * _Nonnull)manager didJoinedOfUid:(NSString *)uid;
    
    /// 远端用户 退出RTC频道回调
    ///
    /// @param manager 连麦管理器
    /// @param uid 远端用户id
    - (void)plvLinkMicManager:(PLVLinkMicManager * _Nonnull)manager didOfflineOfUid:(NSString *)uid;
    
    /// 远端用户 音频流禁止状态更新回调
    ///
    /// @param manager 连麦管理器
    /// @param muted 音频流是否禁止
    /// @param uid 禁止状态更新的用户连麦ID
    - (void)plvLinkMicManager:(PLVLinkMicManager * _Nonnull)manager didAudioMuted:(BOOL)muted byUid:(NSString *)uid;
    
    /// 远端用户 视频流禁止状态更新回调
    ///
    /// @param manager 连麦管理器
    /// @param muted 视频流是否禁止
    /// @param uid 禁止状态更新的用户连麦ID
    - (void)plvLinkMicManager:(PLVLinkMicManager * _Nonnull)manager didVideoMuted:(BOOL)muted byUid:(NSString *)uid;
    
    #pragma mark 通用(自己、别人) 事件回调
    /// 远端用户 全部流已退出房间
    ///
    /// @param manager 连麦管理器
    /// @param uid 远端用户连麦ID
    - (void)plvLinkMicManager:(PLVLinkMicManager * _Nonnull)manager remoteUserTotalStreamsDidLeaveRoom:(NSString *)uid;
    
    /// 全部连麦成员的音频音量 回调
    ///
    /// @note 该回调的时间间隔约为 100ms~300ms
    ///
    /// @param manager 连麦管理器
    /// @param volumeDict 连麦成员音量字典 (key:用户连麦ID,value:对应的流的音量值;value取值范围为 0.0 ~ 1.0)
    - (void)plvLinkMicManager:(PLVLinkMicManager * _Nonnull)manager reportAudioVolumeOfSpeakers:(NSDictionary<NSString *, NSNumber *> * _Nonnull)volumeDict;
    
    @end

    Swift

    protocol PLVLinkMicManagerDelegate : NSObjectProtocol

[ 代理方法 ]

  • PLVRTCStreamerManager 的 Delegate

    See more

    Declaration

    Objective-C

    @protocol PLVRTCStreamerManagerDelegate <NSObject>

    Swift

    protocol PLVRTCStreamerManagerDelegate : NSObjectProtocol
  • PLVSocketManager的协议

    Note

    允许设置多个监听者
    See more

    Declaration

    Objective-C

    @protocol PLVSocketManagerProtocol <NSObject>

    Swift

    protocol PLVSocketManagerProtocol : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol PLVDocumentUploadErrorDelegate <NSObject>
    
    - (void)uploadError:(NSError *)error;
    
    @end

    Swift

    protocol PLVDocumentUploadErrorDelegate : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol PLVDocumentUploadResultDelegate <NSObject>
    
    /// 初次上传上传启动成功回调
    - (void)uploadStartWithModel:(PLVDocumentUploadModel *)model;
    
    /// 上传中断重新上传启动成功/失败回调
    - (void)uploadRestartSuccess:(BOOL)success model:(PLVDocumentUploadModel *)model;
    
    /// 失败重试重新上传启动成功/失败回调
    - (void)uploadRetrySuccess:(BOOL)success model:(PLVDocumentUploadModel *)model;
    
    /// 上传成功/失败时回调
    - (void)uploadSuccess:(BOOL)success model:(PLVDocumentUploadModel *)model;
    
    /// 清理所有上传中断任务时回调
    - (void)updateUploadData;
    
    @end

    Swift

    protocol PLVDocumentUploadResultDelegate : NSObjectProtocol