Skip to content

Commit 9290052

Browse files
Merge pull request #17 from ionic-team/feat/add-video-parameters
Feat/add video parameters
2 parents 378c440 + 72efd81 commit 9290052

2 files changed

Lines changed: 8 additions & 13 deletions

File tree

android/src/main/java/com/capacitorjs/plugins/camera/IonCameraFlow.kt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import io.ionic.libs.ioncameralib.manager.IONCAMRGalleryManager
3333
import io.ionic.libs.ioncameralib.manager.IONCAMRVideoManager
3434
import io.ionic.libs.ioncameralib.model.IONCAMRCameraParameters
3535
import io.ionic.libs.ioncameralib.model.IONCAMREditParameters
36+
import io.ionic.libs.ioncameralib.model.IONCAMRVideoParameters
3637
import io.ionic.libs.ioncameralib.model.IONCAMRError
3738
import io.ionic.libs.ioncameralib.model.IONCAMRMediaResult
3839
import io.ionic.libs.ioncameralib.model.IONCAMRMediaType
@@ -62,11 +63,11 @@ class IonCameraFlow(
6263
private lateinit var editLauncher: ActivityResultLauncher<Intent>
6364
private var currentCall: PluginCall? = null
6465
private var cameraSettings: IonCameraSettings? = null
65-
private var videoSettings: IonVideoSettings? = null
6666
private var gallerySettings: IonGallerySettings? = null
6767
private var editParameters = IONCAMREditParameters(
6868
editURI = "", fromUri = false, saveToGallery = false, includeMetadata = false
6969
)
70+
private var videoParameters: IONCAMRVideoParameters? = null
7071
private var lastEditUri: String? = null
7172

7273
companion object {
@@ -118,7 +119,7 @@ class IonCameraFlow(
118119
}
119120

120121
fun recordVideo(call: PluginCall) {
121-
videoSettings = getVideoSettings(call)
122+
videoParameters = getVideoSettings(call)
122123
currentCall = call
123124
openRecordVideo(call)
124125
}
@@ -186,8 +187,8 @@ class IonCameraFlow(
186187

187188
}
188189

189-
fun getVideoSettings(call: PluginCall): IonVideoSettings {
190-
return IonVideoSettings(
190+
fun getVideoSettings(call: PluginCall): IONCAMRVideoParameters {
191+
return IONCAMRVideoParameters(
191192
saveToGallery = call.getBoolean("saveToGallery") ?: false,
192193
includeMetadata = call.getBoolean("includeMetadata") ?: false,
193194
isPersistent = call.getBoolean("isPersistent") ?: true
@@ -273,7 +274,7 @@ class IonCameraFlow(
273274
}
274275

275276
fun openRecordVideo(call: PluginCall) {
276-
val settings = videoSettings ?: run {
277+
val settings = videoParameters ?: run {
277278
sendError(IONCAMRError.INVALID_ARGUMENT_ERROR)
278279
return
279280
}
@@ -350,6 +351,7 @@ class IonCameraFlow(
350351
saveToGallery = false,
351352
includeMetadata = false
352353
)
354+
353355
val imageBase64 = call.getString("inputImage")
354356
if (imageBase64 == null) return
355357
manager.editImage(activity, imageBase64, editLauncher)
@@ -857,7 +859,7 @@ class IonCameraFlow(
857859
sendError(IONCAMRError.CAPTURE_VIDEO_ERROR)
858860
return
859861
}
860-
val settings = videoSettings ?: run {
862+
val settings = videoParameters ?: run {
861863
sendError(IONCAMRError.INVALID_ARGUMENT_ERROR)
862864
return
863865
}

android/src/main/java/com/capacitorjs/plugins/camera/IonVideoSettings.kt

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)