Skip to content

Commit

Permalink
Merge pull request #89 from spoonconsulting/video-ios-30s-duration
Browse files Browse the repository at this point in the history
Video recording iOS
  • Loading branch information
YushraJewon authored Nov 4, 2024
2 parents 79c6ce6 + ef6d337 commit 0e55296
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [2.0.31](https://github.com/spoonconsulting/cordova-plugin-simple-camera-preview/compare/2.0.30...2.0.31) (2024-11-04)
* **iOS:** Automatic stop video after 30s

## [2.0.30](https://github.com/spoonconsulting/cordova-plugin-simple-camera-preview/compare/2.0.29...2.0.30) (2024-10-04)
* **iOS:** Pause video on when app is in background

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spoonconsulting/cordova-plugin-simple-camera-preview",
"version": "2.0.30",
"version": "2.0.31",
"description": "Cordova plugin that allows camera interaction from HTML code for showing camera preview below or on top of the HTML.",
"keywords": [
"cordova",
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<plugin id="@spoonconsulting/cordova-plugin-simple-camera-preview" version="2.0.30" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<plugin id="@spoonconsulting/cordova-plugin-simple-camera-preview" version="2.0.31" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">

<name>cordova-plugin-simple-camera-preview</name>
<description>Cordova plugin that allows camera interaction from HTML code. Show camera preview popup on top of the HTML.</description>
Expand Down
1 change: 1 addition & 0 deletions src/ios/CameraSessionManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@
@property (nonatomic) AVCaptureVideoDataOutput *dataOutput;
@property (nonatomic, weak) id delegate;
@property (nonatomic) AVCaptureMovieFileOutput *movieFileOutput;
@property (nonatomic) NSTimer *videoTimer;
@end
9 changes: 9 additions & 0 deletions src/ios/CameraSessionManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,22 @@ - (void)startRecording:(NSURL *)fileURL recordingDelegate:(id<AVCaptureFileOutpu
connection.videoOrientation = [self getCurrentOrientation];
}
[self.movieFileOutput startRecordingToOutputFileURL:fileURL recordingDelegate:recordingDelegate];
_videoTimer = [NSTimer scheduledTimerWithTimeInterval:30.0
target:self
selector:@selector(stopRecording)
userInfo:nil
repeats:NO];
}
}

- (void)stopRecording {
if (self.movieFileOutput.isRecording) {
[self.movieFileOutput stopRecording];
}
if (_videoTimer != nil) {
[_videoTimer invalidate];
_videoTimer = nil;
}
}

- (BOOL)deviceHasUltraWideCamera {
Expand Down

0 comments on commit 0e55296

Please sign in to comment.