[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文件导入即可

4340C212-AC1E-4FFB-85A1-1025BDB45356.png

下过如下:

IMG_2861.PNG
9D954611-698F-417E-92EC-9FFF64147398.png
IMG_2863.PNG
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容