AVPlayer
- 作者: 我来自未来丶希望你懂我
- 来源: 51数据库
- 2022-08-17
// // EasyAVPlayer.h // EasyAVPlayer // // Created by Tommy on 15/8/25. // Copyright (c) 2015年 Tommy. All rights reserved. // //????????????????????????? _oo8oo_ //???????????????????????? o8888888o //???????????????????????? 88" . "88 //???????????????????????? (| -_- |) //???????????????????????? 0\? =? /0 //?????????????????????? ___/'==='\___ //???????????????????? .' \\|???? |// '. //??????????????????? / \\|||? :? |||// \ //?????????????????? / _||||| -:- |||||_ \ //????????????????? |?? | \\\? -? /// |?? | //????????????????? | \_|? ''\---/''? |_/ | //????????????????? \? .-\__? '-'? __/-.? / //??????????????? ___'. .'? /--.--\? '. .'___ //???????????? ."" '<? '.___\_<|>_/___.'? >' "". //??????????? | | :? `- \`.:`\ _ /`:.`/ -`? : | | //??????????? \? \ `-.?? \_ __\ /__ _/?? .-` /? / //??????? =====`-.____`.___ \_____/ ___.`____.-`===== //????????????????????????? `=---=` // //????????????????? 佛祖保佑???????? 永无bug // ___ _____ ___ // \ / /\ |\ | | | /\ | | // \ / \ / /--\ | \ | | _ | /__\ | | // \/ \/ / \ | \| |___| | / \ |___| #import <UIKit/UIKit.h> #import <AVFoundation/AVFoundation.h> @interface EasyAVPlayer : UIView @property(strong,nonatomic)UIView *container;//播放器容器 @property(nonatomic,assign)BOOL isStart;//默认一开始是不播放视频的 @property(nonatomic,strong)AVPlayer *player;//播放器对象 @property(strong,nonatomic)UIButton *playOrPause;//播放/暂停按钮 @property(nonatomic,strong)AVPlayerLayer *playerLayer; @property (nonatomic, strong)NSTimer *timer; @property (nonatomic, strong)NSString *movieUrl;//视频播放的链接 /* *Description:静态创建一个视频播放器对象 * *@param: * *@return: * */ +(id)easyAVPlayerWithUrl:(NSString *)urlstr; @end
推荐阅读