我有一个类型为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的UI时,我收到错误“此电影无法播放”。这有什么问题?
答案 0 :(得分:0)
您是在iPhone 3Gs还是iPhone 4上测试视频? 确保视频兼容在3G上播放。 我确定这只是问题所在。
以下是代码段....
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];
答案 1 :(得分:0)
videoEditorController.videoMaximumDuration = 0.0;
?你的意思是 - videoEditorController.videoMaximumDuration = 1000.0;
?