閑暇之余寫了一個機遇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文件導入即可
4340C212-AC1E-4FFB-85A1-1025BDB45356.png
下過如下:
IMG_2861.PNG
9D954611-698F-417E-92EC-9FFF64147398.png
IMG_2863.PNG