2

我有一个视频类型的 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 时出现错误“无法播放此电影”。这里有什么问题?

4

2 回答 2

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];
于 2011-09-22T08:21:21.787 回答
0

videoEditorController.videoMaximumDuration = 0.0;? 你的意思是- videoEditorController.videoMaximumDuration = 1000.0;

于 2012-02-11T11:35:31.547 回答