这是我的代码。我想播放一个存在于设备内存中的视频。视频格式为 .mov。但我只得到了黑屏。
NSString *documentdir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
NSString *tileDirectory = [documentdir stringByAppendingPathComponent:urlpath];
self.videoPlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:tileDirectory]];
[self.videoPlayer.view setFrame:CGRectMake(0, 0, 320, 420)];
[self.videoPlayer prepareToPlay];
[self.view addSubview:self.videoPlayer.view];
[self.videoPlayer play];