2012-04-01 78 views
0

它的问题,当我播放视频显示黑屏和播放音频没有视频,不能做任何事情,但关闭应用程序。 这里是我的代码MPMoviePlayerController“从服务器加载电影

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 


NSString *movieURL = [NSString stringWithFormat:@"http://www.aliakbar84.com/test/%d.mp4",indexPath.row]; 

MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:movieURL]]; 
[moviePlayer play]; 
MPMoviePlayerViewController *movieplayer1 = [[MPMoviePlayerViewController alloc] initWithContentURL:movieurl]; 
[self presentMoviePlayerViewControllerAnimated:movieplayer1]; 
+0

为什么你初始化'MPMoviePlayerController'和'MPMoviePlayerViewController'呢?这不应该做。删除'MPMoviePlayerController'的初始化! – Till 2012-04-01 14:06:53

+0

thaaaanx这么多,它的工作perfictly – Alippo 2012-04-01 14:20:58

+0

我会重复这个提示,以防止未答复的问题。 – Till 2012-04-01 21:28:35

回答

1

为什么你到底是初始化两个,MPMoviePlayerControllerMPMoviePlayerViewController

不应该这样做。删除MPMoviePlayerController的初始化!

相关问题