1

I save a video via iphone database application,the url where i'm recording the video is:

file://localhost/private/var/mobile/Applications/0DB3ABFC-1630-44FF-8506-4B08E3CB2C85/tmp/capture-T0x2591d0.tmp.00fEdr/capturedvideo.MOV

However, when I try to read the video via MediaPlayer it always crashes...

sample code:

NSString *frameName = [info objectForKey:@"UIImagePickerControllerMediaURL"];

NSURL *url = [NSURL URLWithString:frameName];

videoPlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
[self.view addSubview:videoPlayer.view];

videoPlayer.view.frame = CGRectMake(0, 0, 320, 419);
[videoPlayer play];

Thank you in advance.

4

1 回答 1

1

看起来内容[info objectForKey:@"UIImagePickerControllerMediaURL"]无效。

如果它是有效的,fileURLWithPath那就试试吧urlWithString

于 2012-10-04T17:11:53.570 回答