直到现在,我一直使用这一密码来保存从<条码>上获取的录像。
NSURL *url = [info objectForKey:UIImagePickerControllerMediaURL];
NSData *videoData = [NSData dataWithContentsOfURL:url];
path = [kFilesSaveDirectory stringByAppendingFormat:@"%@/Vid%d.mov",album.albumName,album.lastfile];
path2 = [kFilesSaveDirectory stringByAppendingFormat:@"%@/VidImg%d.png",album.albumName,album.lastfile];
[videoData writeToFile:path atomically:NO];
[[videoPlayer moviePlayer] setContentURL:[NSURL URLWithString:path]];
UIImage *image = [[videoPlayer moviePlayer] thumbnailImageAtTime:1.0 timeOption: MPMovieTimeOptionNearestKeyFrame];
[[videoPlayer moviePlayer] setContentURL:nil];
[UIImagePNGRepresentation(image) writeToFile:path2 atomically:YES];
直到现在,第4章中,它一直没有任何问题,但当我试图在第5章中使用它时,它有两个问题:
- it give me nil for the img.
2. 在我想用这部法典播放录像时,不要播放:
[[videoPlayer moviePlayer] setContentURL:[NSURL URLWithString:choosen.bigpath]];
[self presentModalViewController:videoPlayer animated:YES];
[[videoPlayer moviePlayer] play];