MpMoviePlayerController在模拟器中流式传输视频问题

时间:2011-07-15 11:25:34

标签: objective-c ipad

我正在使用MPMoviePlayerController,我正在播放一个视频,该视频位于URL @“http:// www ... xyz ... IT不在模拟器中播放。

NSString *url = @"hhttp://www... xyz...  ";
MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:url]]; 

1 个答案:

答案 0 :(得分:0)

NSString *urlStr = [[NSBundle mainBundle] pathForResource:@"video.mp4" ofType:nil];
NSURL *url = [NSURL fileURLWithPath:urlStr];
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
[self.view addSubview:moviePlayer.view];
moviePlayer.view.frame = CGRectMake(50, 50, 200, 200);  
[moviePlayer play];