Skip to content

Commit

Permalink
Merge branch 'capacitor-4'
Browse files Browse the repository at this point in the history
  • Loading branch information
dragermrb committed Sep 8, 2022
2 parents 5614005 + 785e3ed commit 3b8f965
Show file tree
Hide file tree
Showing 10 changed files with 5,592 additions and 146 deletions.
35 changes: 23 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ npm install @whiteguru/capacitor-plugin-media-capture
npx cap sync
```

### or for Capacitor 3.x

```bash
npm install @whiteguru/[email protected]
npx cap sync
```

## iOS

iOS not available jet
Expand All @@ -32,8 +39,8 @@ This plugin needs `compileSdkVersion = 31` variable (defined in your app's `vari

<docgen-index>

- [`captureVideo(...)`](#capturevideo)
- [Interfaces](#interfaces)
* [`captureVideo(...)`](#capturevideo)
* [Interfaces](#interfaces)

</docgen-index>

Expand All @@ -43,33 +50,28 @@ This plugin needs `compileSdkVersion = 31` variable (defined in your app's `vari
### captureVideo(...)

```typescript
captureVideo(options: CaptureVideoOptions) => any
captureVideo(options: CaptureVideoOptions) => Promise<MediaFileResult>
```

| Param | Type |
| ------------- | ------------------------------------------------------------------- |
| **`options`** | <code><a href="#capturevideooptions">CaptureVideoOptions</a></code> |

**Returns:** <code>any</code>
**Returns:** <code>Promise&lt;<a href="#mediafileresult">MediaFileResult</a>&gt;</code>

--------------------

---

### Interfaces

#### CaptureVideoOptions

| Prop | Type | Description |
| --------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`duration`** | <code>number</code> | Maximum duration per video clip. |
| **`quality`** | <code>"uhd" \| "fhd" \| "hd" \| "sd"</code> | Quality of the video. `uhd` for 4K ultra HD video size (2160p). `fhd` for full HD video size (1080p). `hd` for HD video size (720p). `sd` for SD video size (480p). |
| **`sizeLimit`** | <code>number</code> | Max file size in bytes. |

#### MediaFileResult

| Prop | Type |
| ---------- | ----------------------------------------------- |
| **`file`** | <code><a href="#mediafile">MediaFile</a></code> |


#### MediaFile

| Prop | Type | Description |
Expand All @@ -79,4 +81,13 @@ captureVideo(options: CaptureVideoOptions) => any
| **`type`** | <code>string</code> | The file's mime type |
| **`size`** | <code>number</code> | The size of the file, in bytes. |


#### CaptureVideoOptions

| Prop | Type | Description |
| --------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`duration`** | <code>number</code> | Maximum duration per video clip. |
| **`quality`** | <code>'uhd' \| 'fhd' \| 'hd' \| 'sd'</code> | Quality of the video. `uhd` for 4K ultra HD video size (2160p). `fhd` for full HD video size (1080p). `hd` for HD video size (720p). `sd` for SD video size (480p). |
| **`sizeLimit`** | <code>number</code> | Max file size in bytes. |

</docgen-api>
2 changes: 1 addition & 1 deletion WhiteguruCapacitorPluginMediaCapture.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Pod::Spec.new do |s|
s.author = package['author']
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
s.ios.deployment_target = '12.0'
s.ios.deployment_target = '13.0'
s.dependency 'Capacitor'
s.swift_version = '5.1'
end
23 changes: 11 additions & 12 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ext {
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.1'
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.2.0'
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.2'
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.3.0'
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.4.2'
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.3'
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0'

// CameraX dependencies (first release for video is: "1.1.0-alpha10")
androidxCameraxVersion= project.hasProperty('androidxCameraxVersion') ? rootProject.ext.androidxCameraxVersion : '1.1.0-beta01'
Expand All @@ -14,10 +14,10 @@ buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.android.tools.build:gradle:7.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.4.1"
}
Expand All @@ -29,10 +29,10 @@ apply plugin: 'kotlin-kapt'
apply plugin: "androidx.navigation.safeargs"

android {
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 31
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 32
defaultConfig {
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 21
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 30
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -47,8 +47,8 @@ android {
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

buildFeatures {
Expand All @@ -58,7 +58,6 @@ android {

repositories {
google()
jcenter()
mavenCentral()
}

Expand Down
Binary file modified android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 3b8f965

Please sign in to comment.