SBVideoCaptureDemo
SBVideoCaptureDemo copied to clipboard
有时候在回删视频片段的时候出现crash
下次再次出现的话,我把crash的截图发上来
具体操作流程如下: 1.点击主页button进入相机页面 2.轻点录制按钮,手指马上离开按钮和屏幕 3.这时候发现,进度条一直在动。 4.不要等待录制完成,在这中间,重复2的操作。 5.然后多次点击回删按钮,就crash了。
好像确实存在这个问题:
问题反馈: 1、在录制界面,有时候点击一下按钮,进度条就会一直向右增加。正常应该是按住才录制。 2、当分割的片段过多时,在iOS7 4S上就会crash。
@xhzengAIB 这个问题,后来有解决吗?
没有
我通过UILongPressGestureRecognizer 替换之前的touch,并且不使用下面两个方法:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event 而是通过下面方式:
- (void)processGestureRecognizer:(UIGestureRecognizer *)gesture { if ([gesture isKindOfClass:[UILongPressGestureRecognizer class]]) { UILongPressGestureRecognizer *longPress = (UILongPressGestureRecognizer *)gesture; if (longPress.state == UIGestureRecognizerStateBegan) { NSString *filePath = [SBCaptureToolKit getVideoSaveFilePathString]; [_recorder startRecordingToOutputFileURL:[NSURL fileURLWithPath:filePath]]; }else if (longPress.state == UIGestureRecognizerStateEnded) { [_recorder stopCurrentVideoRecording]; } } } 去调用开始录制视频,得以解决。
录制过程中分割的片段过多时这种造成的crash目前还没遇到,但是有遇到分割片段过多mergeAndExportVideosAtFileURLs后,视频是黑的,无法播放。
已解决