闲暇之余写了一个机遇MPMoviePlayerController的视频播放器,支持格式支持:MOV、MP4、M4V、与3GP等格式,定制化高,可放大缩小,声音 亮度 快进等皆可。
gitHub传送门 :QPlayer
使用方式如下:
- (void)viewDidLoad {
[super viewDidLoad];
CGFloat width = [UIScreen mainScreen].bounds.size.width;
self.videoView = [[ContentVideoView alloc]init];
self.videoView.frame = CGRectMake(0, 64, width, width*(9.0/16.0));
__weak typeof(self)weakSelf = self;
[self.videoView setPlayerVeiwBackOrientationPortrait:^{
[weakSelf toolbarHidden:NO];
}];
[self.videoView setPlayerVeiwChangeToFullscreenMode:^{
[weakSelf toolbarHidden:YES];
}];
[self.view addSubview:self.videoView];
// Do any additional setup after loading the view, typically from a nib.
// [self playVideo];
}
//隐藏navigation tabbar 电池栏
- (void)toolbarHidden:(BOOL)Bool{
self.navigationController.navigationBar.hidden = Bool;
self.tabBarController.tabBar.hidden = Bool;
[[UIApplication sharedApplication] setStatusBarHidden:Bool withAnimation:UIStatusBarAnimationFade];
}
把QVideoPlayer文件导入即可
下过如下: