Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

你的demo如果录制视频点击几次屏幕后会崩溃,reason: '*** -[AVAssetWriter finishWritingWithCompletionHandler:] Cannot call method when status is 2' #5

Open
xinyu1105 opened this issue May 8, 2018 · 0 comments

Comments

@xinyu1105
Copy link

xinyu1105 commented May 8, 2018

  • (void)stopWritingWithError:(NSError **)error {

self.isWriting = NO;

dispatch_async(self.dispatchQueue, ^{

[self.assetWriter finishWritingWithCompletionHandler:^{
	
	if (self.assetWriter.status == AVAssetWriterStatusCompleted) {
		
		dispatch_async(dispatch_get_main_queue(), ^{
			if ([self.delegate respondsToSelector:@selector(videoWriter:didOutputVideoAtPath:)]) {
				[self.delegate videoWriter:self didOutputVideoAtPath:self.assetWriter.outputURL];
			}
		});
		
	} else {
		
		*error = self.assetWriter.error;
		
	}
    self.assetWriter = nil;
}];

});
}

这个怎么解决呢?麻烦回复下,谢谢!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant