Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions LLSimpleCamera/LLSimpleCamera.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ typedef enum : NSUInteger {
*/
@property (nonatomic, copy) void (^onError)(LLSimpleCamera *camera, NSError *error);

/**
* Triggered when camera starts recording
*/
@property (nonatomic, copy) void (^onStartRecording)(LLSimpleCamera* camera);

/**
* Camera quality, set a constants prefixed with AVCaptureSessionPreset.
* Make sure to call before calling -(void)initialize method, otherwise it would be late.
Expand Down
2 changes: 2 additions & 0 deletions LLSimpleCamera/LLSimpleCamera.m
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ - (void)initialize
- (void)stop
{
[self.session stopRunning];
self.session = nil;
}


Expand Down Expand Up @@ -403,6 +404,7 @@ - (void)stopRecording:(void (^)(LLSimpleCamera *camera, NSURL *outputFileUrl, NS
- (void)captureOutput:(AVCaptureFileOutput *)captureOutput didStartRecordingToOutputFileAtURL:(NSURL *)fileURL fromConnections:(NSArray *)connections
{
self.recording = YES;
if(self.onStartRecording) self.onStartRecording(self);
}

- (void)captureOutput:(AVCaptureFileOutput *)captureOutput didFinishRecordingToOutputFileAtURL:(NSURL *)outputFileURL fromConnections:(NSArray *)connections error:(NSError *)error
Expand Down