火锅SDK类图2.0版本
2019-09-19 22:03:57 12 举报
当前播SDK类图
作者其他创作
大纲/内容
是否需要询问supplier?
UIViewController
- autoPlayManager:QHPAutoPlayManager
QHPTableViewFocusCalculator
应用层
QHPPreloadProtocol
- canPreloadData(handler:indexPath:container:)- dataPreloadList(handler:indexPath:container:)- canPreloadPlayer(handler:indexPath:container:)- playerPreloadList(handler:indexPath:container:)
QHPPlayNextManagerDataSource
- getTopMonitor:QHPFocusMonitor
QHPFocusDriverDelegate
- driverDidTrigger()- viewDidEndDisplaying(driver:view:indexPath:)- viewWillDispaly(driver:view:indexPath:)
tableview的实现
QHPPlayerDelegate
- playerOnComplete:- player:progressUpdate:- playerOnPlay:- playerOnPause:- playerOnStop:...
驱动代理
QHPScrollViewFocusDriver
播放器统一协议
QHPAutoPlayManagerDataSource
QHPFocusMonitor
- delegate:id<QHPFocusMonitorDelegate>- focusContainer:UIView *- focusSupplier:UIView *- parent: QHPFocusMonitor- child: QHPFocusMonitor
- init(driver:calculator:)- replace(driver:)- replace(calculator:)- recalculate()- appoint(indexpath:NSIndexPath)- appoint(contaienr:UIView<PlayerContainerProtocol>)
QHPFocusMonitorDelegate
QHPCollectionViewFocusCalculator
QHPPlayerHandlerProtocol
- delegates:id<PlayerDelegate>- dataSource:id<QHPPlayerHandlerDataSource>- dataPreloadManager: id<PreloadDataManagerProtcol>- preparedList: NSArray<id<QHPPlayerProtocol>>- playing:id<QHPPlayerProtocol>- reusePool: NSMutableSet<id<QHPPlayerProtocol>>
- didChangeFocus(from:id<QHPPlayerContainerProtocol>to:id<QHPPlayerContainerProtocol>)- containerWillDisplay(container:id<QHPPlayerContainerProtocol>)- containerDidEndDisplay(container::id<QHPPlayerContainerProtocol>)- removeAllPlayers()- dequeuePlayerWithIdentifier()- play()- pause()- resume()
UITableViewCell/UICollectionViewCell<QHPFocusMonitorSupplier>
- monitor: QHPFocusMonitor
UITableView
计算当前聚焦视图的模块
UITableViewCell/UICollectionViewCell<QHPPlayerContainerProtocol>
QHPPlayerProtocol
- initWithType:(NSString *)type- preloading- prepareForReuse- play- pause- loadVideo- moveToSuperView- detachFromSuperView- type: NSString- dataid: NSString- addDelegate:- removeDelegate:
QHPAutoPlayManagerDelegate
续播模块
QHPAutoPlayManager
- monitor- handler: id<QHPPlayerHandlerProtocol>- dataSource:id<QHPAutoPlayManagerDataSource>- delegate:id<QHPAutoPlayManagerDelegate>
- init(monitor:):instancetype- init(collectionview:):instancetype- init(tableview:):instancetype- pageAppear()- pageDisappear()
QHPFocusMonitorSupplier
@required- monitor: QHPFocusMonitor@optional- isVisibilityAvaliable(insets:): BOOL
QHPPlayerContainerProtocol
@required- videoInfo- playerSuperView@optional- willAddPlayer(handler:player:)- didAddPlayer(handler:player:)- willRemovePlayer(handler:player:)- didRemovePlayer(handler:player:)- isAutoPlay:BOOL
自动播放组件
续播接口
监听scrollView滚动回调、cell可见与不可见
collectionview的实现
QHPFocusDriver
- delegate:id<QHPFocusDriverDelegate>- isActive:BOOL
- start()- stop()- trigger()
QHPFocusCalculator
- viewVisibleEdgeInsetsProvider: UIEdgeInsets(^)(UIView *) // 待定- viewVisibilityChecker: BOOL(^)(UIView *)
- findTargetPlayerContainerUsingBlock(resultBlock:)- indexPathForPlayerContainer(container:): NSIndexPath- containerAtIndexPath(indexPath): UIView<QHPPlayerContainerProtocol>- makeIndexPathFocus(indexPath:)
QHPPlayerHandlerDataSource
// 获取播放器- player(handler:indexPath:container:):id<playerProtocol>// 预加载manager(p2p预加载)- dataPreloadManager:id<PreloadDataManagerProtcol>
UICollectionView
播放器管理协议
自研播放器数据源协议
抛出当前聚焦视图的模块
驱动模块
QHPPlayNextManager
- datasource: id<QHPPlayNextManagerDataSource>
- init(monitor:):instancetype- onPlayComplete(player:)
嵌套列表时需要实现该协议
播放器管理类
QHPPlayerHandler
- forwardInvocation: // 转发播放器回调给container层级链
播放器容器需要实现的协议
QHPPlayNextProtocol
- canPlayNext(container:indexPath:)- nextIndexPath(container:indexPath:)
UIScrollViewDelegate
收藏
0 条评论
下一页