アプリケーションで MPMoviePlayerController を使用しました。
正しい URL を取得しましたが、MPMoviePlayer でビデオが再生されず、黒い画面しか表示されません。
私のコードは以下の通りです:
[video setImage:[UIImage imageNamed:@"video_active.png"] forState:UIControlStateNormal];
NSString *filename=[NSString stringWithFormat:@"%@.mp4",[appdel.TempVideoUrl valueForKey:tag]];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *filePath = [documentsDirectory stringByAppendingPathComponent:filename];
NSURL *movieURL = [NSURL fileURLWithPath:filePath] ;
theMovie = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
theMovie.view.frame = CGRectMake(106, 18, 216, 235);
[uploadview addSubview:theMovie.view];
// Play the movie.
[theMovie pause];
次のような URL を取得しました: file://localhost/var/mobile/Applications/6E1D4CB7-A08D-438B-9FE7-E2FD9B7B5EEC/Documents/136_1355227629.mp4