我有一个类型为video的ALAsset对象。我想用UIVideoEditorController裁剪这个视频。以下是代码片段:
UIVideoEditorController *videoEditorController = [[UIVideoEditorController alloc] init];
videoEditorController.delegate = self;
videoEditorController.videoMaximumDuration = 0.0;
videoEditorController.videoQuality = UIImagePickerControllerQualityTypeHigh;
videoEditorController.videoPath = @"assets-library://asset/asset.MOV?id=1000000005&ext=MOV";
[inViewController presentModalViewController:videoEditorController animated:YES];
self.videoEditController = videoEditorController;
[videoEditorController release];当UIVideoEditorController的用户界面被推送时,我得到一个错误‘这部电影无法播放’。这里的问题是什么?
发布于 2011-09-22 16:21:22
您是在iPhone 3Gs还是iPhone 4上测试视频?确保视频兼容在3Gs上播放。我确信这是唯一的问题。
下面是代码片段...
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
NSString *filePathString = [[NSBundle mainBundle] pathForResource:@"Don2" ofType:@"m4v"];
NSURL *filePathURL = [NSURL fileURLWithPath:filePathString isDirectory:NO];
if ([library videoAtPathIsCompatibleWithSavedPhotosAlbum:filePathURL]) {
[library writeVideoAtPathToSavedPhotosAlbum:filePathURL completionBlock:^(NSURL *assetURL, NSError *error){
if (error) {
// TODO: error handling
NSLog(@"Error");
} else {
// TODO: success handling
}
}];
}
[library release];发布于 2012-02-11 19:35:32
videoEditorController.videoMaximumDuration = 0.0;?你的意思是- videoEditorController.videoMaximumDuration = 1000.0;
https://stackoverflow.com/questions/6057667
复制相似问题