iOS -AVPlayerViewController简单使用

-(void)playVideoWithUrl:(NSURL *)url{
    AVPlayerViewController *playerViewController = [[AVPlayerViewController alloc]init];
    playerViewController.player = [[AVPlayer alloc]initWithURL:url];
    [self presentViewController:playerViewController animated:YES completion:nil];
    playerViewController.view.frame = self.view.frame;
    [playerViewController.player play];
}

是不是炒鸡简单!?

iOS -AVPlayerViewController简单使用_第1张图片
图片.png

你可能感兴趣的:(iOS -AVPlayerViewController简单使用)