[iOS]MoviePlayerController播放器

闲暇之余写了一个机遇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文件导入即可

[iOS]MoviePlayerController播放器_第1张图片
4340C212-AC1E-4FFB-85A1-1025BDB45356.png

下过如下:

[iOS]MoviePlayerController播放器_第2张图片
IMG_2861.PNG
[iOS]MoviePlayerController播放器_第3张图片
9D954611-698F-417E-92EC-9FFF64147398.png
IMG_2863.PNG

你可能感兴趣的:([iOS]MoviePlayerController播放器)