IOS  播放视频

导入多媒体库MediaPlayer.framework
只是用到其中的MPMoviePlayerController.h 和 MPMoviePlayerViewController.h

代码:
     MPMoviePlayerViewController *controller = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:@"http://loary.sinaapp.com/ttb.mp4"]]; //本地和网络上的视频文件都能播放,且是边加载边播放  另外对于网络上的资源,还能判断是视频文件还是视频流
    //MPMovieLoadState state = controller.moviePlayer.loadState;
    controller.moviePlayer.shouldAutoplay = NO;
    //controller.moviePlayer.initialPlaybackTime = 10.0;
    [self presentMoviePlayerViewControllerAnimated:controller];
原文地址:https://www.cnblogs.com/cnsec/p/11515822.html