我目前正在开发一个与视频相关的应用程序。
在我的应用中,用户可以裁剪视频,我有一个自定义控件来选择开始时间和结束时间。我需要通过这两个值来裁剪视频。我尝试使用 UIVideoEditorController
如下。
UIVideoEditorController* videoEditor = [[[UIVideoEditorController alloc] init] autorelease];
videoEditor.delegate = self;
NSString* videoPath = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"MOV"];
if ( [UIVideoEditorController canEditVideoAtPath:videoPath] )
{
videoEditor.videoPath = videoPath;
[self presentModalViewController:videoEditor animated:YES];
}
else
{
NSLog( @"can't edit video at %@", videoPath );
}
但问题在于上述代码会显示苹果的视频编辑控件,用户可以在该视图上执行一些操作。我不想显示这个视图,因为我已经在MPMoviePlayer
上显示了视频,并在自定义控件上接收了用户输入(开始时间和结束时间)以剪辑视频。
如何在不显示UIVideoEditorController
的情况下剪辑视频?