下面的MPMoviePlayerController不会出现在我的iOS应用程序中。
我正在尝试使它在我的tableView行被选中时出现:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:videoUrl]];
[player setFullscreen:YES];
[player play];
[self.tableView addSubview:player.view];
}有什么想法吗?
发布于 2014-03-19 02:23:50
相反,请尝试:
MPMoviePlayerViewController *player = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:videoUrl]];
[player prepareToPlay];
[self presentViewController:player animated:YES completion:nil];发布于 2014-03-19 02:25:49
player.view一个大小了。prepareToPlay了。如果不这样做,MPMoviePlayerController绝对不会播放。https://stackoverflow.com/questions/22486798
复制相似问题