在MPMoviePlayerViewController
中,只有音频有效,但视频未显示。它适用于iphone 4和ios 7的iphone 4,4s等。
NSURL *movieURL = [NSURL URLWithString:@"https://examplevideo.mp4"];
self.playercontroller = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
[self.playercontroller.view setFrame:CGRectMake(0, 0, 320, 320)];
self.playercontroller.contentURL = movieURL;
[self.view addSubview:self.playercontroller.view];
[self.playercontroller play];
答案 0 :(得分:0)
将视图添加到[self.playercontroller play]
后,您应尝试致电self.view
,而不是之前。