美文网首页
[iOS]MoviePlayerController播放器

[iOS]MoviePlayerController播放器

作者: Kean_Qi | 来源:发表于2016-08-19 15:54 被阅读456次

闲暇之余写了一个机遇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

相关文章

网友评论

      本文标题:[iOS]MoviePlayerController播放器

      本文链接:https://www.haomeiwen.com/subject/bipbsttx.html