代码如下
NSString * filePath = @"视频文件全路径";
NSURL * url = [NSURL URLWithString:filePath];
MPMoviePlayerViewController *moviePlayer = [[[MPMoviePlayerViewController alloc] initWithContentURL:url] autorelease];
[self presentMoviePlayerViewControllerAnimated:moviePlayer];
在模拟器上,一直显示loading…
错误在
//NSURL * url = [NSURL URLWithString:filePath];
//应改为 fileURLWithPath
NSURL * url = [NSURL fileURLWithPath:filePath];