【发布时间】:2010-10-07 19:52:10
【问题描述】:
所以我的应用程序中会弹出一个警报视图,单击视图按钮时应该播放视频,但模拟器中没有任何反应。我不想在设备上测试它,直到我让它在模拟器中工作。据我所知,这是下面的代码应该可以工作。它到达 Log 语句并输出到控制台,但视频不播放。有什么想法吗?
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex: (NSInteger)buttonIndex{
if (buttonIndex == 1) {
NSURL *url = [NSURL URLWithString:@"http://srowley.co.uk/endyVid.mp4"];
MPMoviePlayerController *player = [[[MPMoviePlayerController alloc] initWithContentURL:url] autorelease];
//---play movie---
[player setFullscreen:YES];
[self.view addSubview:[player view]];
NSLog(@"Player Should play!");
[player play];
}
}
【问题讨论】:
标签: iphone xcode video ios-simulator