- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
UIView *showPlayerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
showPlayerView.backgroundColor = [UIColor blackColor];
[self.view addSubview:showPlayerView];
[self.playerManager playWithUrl:@"http://vfx.mtime.cn/Video/2019/05/07/mp4/190507094456874251.mp4" inView:showPlayerView];
[self.playerManager seekToTimePlay:14];
}
- (CXPlayerManager *)playerManager {
if (!_playerManager) {
_playerManager = [[CXPlayerManager alloc] init];
_playerManager.disMissBlock = self.disMissBlock;
_playerManager.shareBlock = self.shareBlock;
_playerManager.playerStatusBlock = self.playerStatusBlock;
}
return _playerManager;
}
CXPlayer is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'CXPlayer'
caixiang305621856, yanyan305621856@sina.com
CXPlayer is available under the MIT license. See the LICENSE file for more info.