CLPlayer是封裝的AVPlayer。在所有封裝AVPlayer的dome活著第三方中,CLPlayer不是最好的,但是是最簡單易懂,最易上手的之一。剛剛做了一個視頻的小項目。
以下是一些簡單的操作
/**視頻url*/
@property (nonatomic,strong) NSURL *url;
/**旋轉(zhuǎn)自動全屏,默認(rèn)Yes*/
@property (nonatomic,assign) BOOL autoFullScreen;
/**重復(fù)播放,默認(rèn)No*/
@property (nonatomic,assign) BOOL repeatPlay;
/**是否支持橫屏,默認(rèn)No*/
@property (nonatomic,assign) BOOL isLandscape;
/**播放*/
- (void)playVideo;
/**暫停*/
- (void)pausePlay;
/**返回按鈕回調(diào)方法*/
- (void)backButton:(BackButtonBlock) backButton;
/**播放完成回調(diào)*/
- (void)endPlay:(EndBolck) end;
/**銷毀播放器*/
- (void)destroyPlayer;
/**
根據(jù)播放器所在位置計算是否滑出屏幕,
@param tableView Cell所在tableView
@param cell 播放器所在Cell
@param beyond 滑出后的回調(diào)
*/
- (void)calculateWith:(UITableView *)tableView cell:(UITableViewCell *)cell beyond:(BeyondBlock) beyond;
最后是Demo的鏈接:祝大家學(xué)習(xí)工作愉快
https://github.com/JmoVxia/CLPlayer