解决视频播放时,在IOS 7.1系统上黑屏的问题:
网上找了好多视频播放的文章都是黑屏,终于找到合适的了,保存一下。
-(void)btnClick{
MPMoviePlayerViewController *_moviePlayerController= [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:VIDEO_URL]];
[_moviePlayerController.view setFrame:CGRectMake(0,0,320,200)];
_moviePlayerController.moviePlayer.movieSourceType=MPMovieSourceTypeFile;
[_moviePlayerController.moviePlayer setScalingMode:MPMovieScalingModeNone];
[_moviePlayerController.moviePlayer setRepeatMode:MPMovieRepeatModeNone];
[_moviePlayerController.moviePlayer setControlStyle:MPMovieControlStyleNone];
[_moviePlayerController.moviePlayer setFullscreen:NO animated:YES];
[_moviePlayerController.moviePlayer play];
UIView *moviePlayView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 320, 200)];
[self.view addSubview:moviePlayView];
[moviePlayView addSubview:[_moviePlayerController.moviePlayer view]];
}