Protocols
The following protocols are available globally.
-
Undocumented
See moreDeclaration
Objective-C
@protocol PLVFeedViewDataSource <NSObject> @required /// 提供集合视图包含的section(分区)数量 - (NSInteger)numberOfSectionsInFeedView:(PLVFeedView *)feedView; /// 提供每个section包含的item(单元格)数量 - (NSInteger)feedView:(PLVFeedView *)feedView numberOfItemsInSection:(NSInteger)section; /// 根据IndexPath提供对应遵循PLVFeedItemCustomViewDelegate的视图 - (UIView <PLVFeedItemCustomViewDelegate>*)feedView:(PLVFeedView *)feedView contentViewForItemAtIndexPath:(NSIndexPath *)indexPath; /// 上拉刷新回调 /// /// @param feedView feed流组件 /// @param completion 完成回调,不执行触发completion不会进行下次回调 - (void)feedViewNeedsRefresh:(PLVFeedView *)feedView completion:(void (^)(BOOL refresh))completion; /// 下拉加载回调 /// /// @param feedView feed流组件 /// @param completion 完成回调,不执行触发completion不会进行下次回调 - (void)feedViewNeedsLoadMore:(PLVFeedView *)feedView completion:(void (^)(BOOL lastPage))completion; @end
Swift
protocol PLVFeedViewDataSource
-
Undocumented
See moreDeclaration
Objective-C
@protocol PLVFeedItemCustomViewDelegate <NSObject> // 视图复用ID @property (nonatomic, strong) NSString *reuseIdentifier; // 视图必须实现的协议方法 - (void)setActive:(BOOL)active; @end
Swift
protocol PLVFeedItemCustomViewDelegate
-
Undocumented
See moreDeclaration
Objective-C
@protocol PLVWebViewPictureInPictureLifeManagerDelegate <NSObject> @optional /// 画中画将要开始 /// @param pipManager 画中画管理器 - (void)plvPIPLifeManagerPictureInPictureWillStart:(PLVWebViewPictureInPictureLifeManager *)pipManager; /// 画中画已经开始 /// @param pipManager 画中画管理器 - (void)plvPIPLifeManagerPictureInPictureDidStart:(PLVWebViewPictureInPictureLifeManager *)pipManager; /// 画中画开启失败 /// @param pipManager 画中画管理器 /// @param error 失败错误原因 - (void)plvPIPLifeManager:(PLVWebViewPictureInPictureLifeManager *)pipManager pictureInPictureFailedToStartWithError:(NSError *)error; /// 画中画将要停止 /// @param pipManager 画中画管理器 - (void)plvPIPLifeManagerPictureInPictureWillStop:(PLVWebViewPictureInPictureLifeManager *)pipManager; /// 画中画已经停止 /// @param pipManager 画中画管理器 - (void)plvPIPLifeManagerPictureInPictureDidStop:(PLVWebViewPictureInPictureLifeManager *)pipManager; /// 点击画中画恢复按钮,画中画关闭之前的用户界面恢复实现 /// @param completionHandler completionHandler - (void)plvPIPLifeManagerRestoreUserInterfaceForPictureInPictureStopWithCompletionHandler:(void (^)(BOOL restored))completionHandler; @end
Swift
protocol PLVWebViewPictureInPictureLifeManagerDelegate : NSObjectProtocol
-
Undocumented
See moreDeclaration
Objective-C
@protocol PLVFloatableWebViewBridgeDelegate <NSObject> @optional #pragma mark Float /// 用户信息的回调 /// @param userInfo 用户信息 - (void)webviewBridge:(PLVFloatableWebViewBridge *)bridge liveUserInfo:(NSDictionary *)userInfo; /// 直播频道信息的回调 /// @param channelInfo 频道信息 - (void)webviewBridge:(PLVFloatableWebViewBridge *)bridge liveChannelInfo:(NSDictionary *)channelInfo; /// 点击商品的回调 /// @param link 需要新跳转的链接 /// @param data 第三方应用信息(客户自定义使用) /// @param size 小窗尺寸 /// @param newPage 是否需要新建小窗 - (void)webviewBridge:(PLVFloatableWebViewBridge *)bridge changeToWindowForProduct:(NSString *)link data:(NSDictionary *)data size:(CGSize)size newPage:(BOOL)newPage; /// 小窗恢复全屏的回调 - (void)webviewBridgeDidChangeToNormal:(PLVFloatableWebViewBridge *)bridge; /// 小窗关闭的回调 - (void)webviewBridgeDidCloseWindow:(PLVFloatableWebViewBridge *)bridge; #pragma mark Event /// 隐藏/显示导航条事件的回调 /// @param hide YES 隐藏 NO显示 - (void)webviewBridge:(PLVFloatableWebViewBridge *)bridge hideNavigationBar:(BOOL)hide; /// 返回上一页的回调 - (void)webviewBridgeGoBack:(PLVFloatableWebViewBridge *)bridge; /// 分享的回调 - (void)webviewBridgeShare:(PLVFloatableWebViewBridge *)bridge; /// 收藏的回调 - (void)webviewBridgeCollect:(PLVFloatableWebViewBridge *)bridge; /// 屏幕旋转的回调 /// @param orientation 旋转方向 - (void)webviewBridge:(PLVFloatableWebViewBridge *)bridge rotateOrientation:(UIDeviceOrientation)orientation; /// 获取后台是否自动开启小窗的回调 - (void)webviewBridgeAutoFloatWindowEnable:(PLVFloatableWebViewBridge *)bridge; /// 是否开启后台自动小窗的回调 /// @param enable YES 开启 NO 不开启 - (void)webviewBridge:(PLVFloatableWebViewBridge *)bridge enableAutoFloatWindow:(BOOL)enable; /// 当前直播间直播状态的回调 /// @param status 直播状态 play、paused - (void)webviewBridge:(PLVFloatableWebViewBridge *)bridge liveRoomPlayStatus:(NSString *)status; /// 当前播放器播放时间的回调 /// @param playbackTime 当前播放时间 - (void)webviewBridge:(PLVFloatableWebViewBridge *)bridge currentPlaybackTime:(NSTimeInterval)playbackTime; /// 获取当前网络状态的回调 - (void)webviewBridgeGetCurrentNetworkStatus:(PLVFloatableWebViewBridge *)bridge; /// 需要锁定 Feed 滑动的回调 - (void)webviewBridgeToLockViewDrag:(PLVFloatableWebViewBridge *)bridge; /// 需要解锁 Feed 滑动的回调 - (void)webviewBridgeToUnlockViewDrag:(PLVFloatableWebViewBridge *)bridge; /// 需要Feed 滑动至下一个 的回调 - (void)webviewBridgeToNextWebview:(PLVFloatableWebViewBridge *)bridge; /// 需要Feed 滑动至上一个的回调 - (void)webviewBridgeToPrevWebview:(PLVFloatableWebViewBridge *)bridge; /// 其它事件的回调 /// @param event 其它事件数据 - (void)webviewBridge:(PLVFloatableWebViewBridge *)bridge handlerOtherEvent:(NSDictionary *)event; @end
Swift
protocol PLVFloatableWebViewBridgeDelegate : NSObjectProtocol
-
Undocumented
See moreDeclaration
Objective-C
@protocol PLVWebViewFeedDataManagerDelegate <NSObject> @optional /// 刷新 feed 数据的回调(页码默认为1) /// @param completion 直播间观看链接数组的回调 /// @param failure 请求失败的回调 - (void)feedDataManager:(PLVWebViewFeedDataManager *)feedDataManager refreshDataWithCompletion:(void (^)(NSArray<PLVWebViewConfig *> *dataArray))completion failure:(void (^)(NSError *error))failure; /// 加载更多直播间数据的回调 /// @param page 加载页码 /// @param completion 直播间观看链接数组的回调 /// @param failure 请求失败的回调 - (void)feedDataManager:(PLVWebViewFeedDataManager *)feedDataManager loadMoreDataWithPage:(NSInteger)page completion:(void (^)(NSArray<PLVWebViewConfig *> * _Nullable dataArray, BOOL lastPage))completion failure:(void (^)(NSError *error))failure; @end
Swift
protocol PLVWebViewFeedDataManagerDelegate : NSObjectProtocol