视频播放,横屏切换CLPlayer(转载)

CLPlayer是封装的AVPlayer。在所有封装AVPlayer的dome活着第三方中,CLPlayer不是最好的,但是是最简单易懂,最易上手的之一。刚刚做了一个视频的小项目。

以下是一些简单的操作

/**视频url*/

@property (nonatomic,strong) NSURL *url;

/**旋转自动全屏,默认Yes*/

@property (nonatomic,assign) BOOL autoFullScreen;

/**重复播放,默认No*/

@property (nonatomic,assign) BOOL repeatPlay;

/**是否支持横屏,默认No*/

@property (nonatomic,assign) BOOL isLandscape;

/**播放*/

- (void)playVideo;

/**暂停*/

- (void)pausePlay;

/**返回按钮回调方法*/

- (void)backButton:(BackButtonBlock) backButton;

/**播放完成回调*/

- (void)endPlay:(EndBolck) end;

/**销毁播放器*/

- (void)destroyPlayer;

/**

根据播放器所在位置计算是否滑出屏幕,

@param tableView Cell所在tableView

@param cell 播放器所在Cell

@param beyond 滑出后的回调

*/

- (void)calculateWith:(UITableView *)tableView cell:(UITableViewCell *)cell beyond:(BeyondBlock) beyond;


最后是Demo的链接:祝大家学习工作愉快

https://github.com/JmoVxia/CLPlayer

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容