【发布时间】:2011-07-11 12:17:01
【问题描述】:
我想修剪视频,所以我正在使用 UIVideoEditorController,但是当我检查可以编辑文件时,它会为所有文件(mp4、mov、m4v)返回 false。所以任何人都会请指导我这是什么问题。
- 能否给我任何使用 UIVIdeoEditorcontroller 的教程的链接
【问题讨论】:
标签: iphone cocoa-touch uivideoeditorcontroller
我想修剪视频,所以我正在使用 UIVideoEditorController,但是当我检查可以编辑文件时,它会为所有文件(mp4、mov、m4v)返回 false。所以任何人都会请指导我这是什么问题。
【问题讨论】:
标签: iphone cocoa-touch uivideoeditorcontroller
UIVideoEditorController 在模拟器上不起作用,所以它总是返回 false,它在设备上可以正常工作。
【讨论】:
您可以通过UIVideoEditorController的路径找到视频编辑。
UIVideoEditorController* videoEditor = [[UIVideoEditorController alloc] init];
videoEditor.delegate=self;
NSString* videoPath = [[NSBundle mainBundle] pathForResource:@"video" ofType:@"MOV"];
if ( [UIVideoEditorController canEditVideoAtPath:videoPath] )
{
videoEditor.videoPath = videoPath;
videoEditor.videoMaximumDuration = 10.0;
//[self.customAvPlayerView addSubview:videoEditor.view];
[self presentViewController:videoEditor animated:YES completion:nil];
}
else
{
NSLog( @"can't edit video at %@", videoPath );
}
http://www.raywenderlich.com/forums/viewtopic.php?t=11571&p=60182
【讨论】: