Skip to content

Commit 28fa2f8

Browse files
Merge pull request #7 from ionic-team/feat/RMET-4098/add-persistent-video-android
feat(android): add isPersistent to RecordVideo
2 parents db7e21b + 7988654 commit 28fa2f8

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,8 @@ class CameraPlugin : Plugin() {
253253
fun getVideoSettings(call: PluginCall): VideoSettings {
254254
return VideoSettings(
255255
saveToGallery = call.getBoolean("saveToGallery") ?: false,
256-
includeMetadata = call.getBoolean("includeMetadata") ?: false
256+
includeMetadata = call.getBoolean("includeMetadata") ?: false,
257+
isPersistent = call.getBoolean("isPersistent") ?: true
257258
)
258259
}
259260

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,13 @@ class IonCameraFlow(
6565
setupLaunchers()
6666
cameraManager = IONCAMRCameraManager(
6767
plugin.getAppId(),
68-
".fileprovider",
6968
IONCAMRExifHelper(),
7069
IONCAMRFileHelper(),
7170
IONCAMRMediaHelper(),
7271
IONCAMRImageHelper()
7372
)
7473

7574
videoManager = IONCAMRVideoManager(
76-
".fileprovider",
7775
IONCAMRFileHelper(),
7876
)
7977

@@ -86,7 +84,6 @@ class IonCameraFlow(
8684

8785
editManager = IONCAMREditManager(
8886
plugin.getAppId(),
89-
".fileprovider",
9087
IONCAMRExifHelper(),
9188
IONCAMRFileHelper(),
9289
IONCAMRMediaHelper(),
@@ -527,14 +524,18 @@ class IonCameraFlow(
527524
val uri = Uri.fromFile(file)
528525

529526
val ret = JSObject()
530-
ret.put("path", mediaResult.uri)
527+
ret.put("type", mediaResult.type)
528+
ret.put("uri", mediaResult.uri)
529+
ret.put("thumbnail", mediaResult.thumbnail)
531530
ret.put("webPath", FileUtils.getPortablePath(plugin.context, plugin.bridge.localUrl, uri))
532531
ret.put("saved", mediaResult.saved)
533532

534533
mediaResult.metadata?.let { metadata ->
535534
ret.put("duration", metadata.duration)
536535
ret.put("size", metadata.size)
537536
ret.put("format", metadata.format)
537+
ret.put("resolution", metadata.resolution)
538+
ret.put("creationDate", metadata.creationDate)
538539
}
539540
currentCall?.resolve(ret)
540541
currentCall = null
@@ -622,6 +623,7 @@ class IonCameraFlow(
622623
plugin.activity,
623624
uri,
624625
settings.saveToGallery,
626+
settings.isPersistent,
625627
settings.includeMetadata,
626628
{ mediaResult ->
627629
handleVideoMediaResult(mediaResult)

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ package com.capacitorjs.plugins.camera
22

33
data class VideoSettings(
44
val saveToGallery: Boolean = false,
5-
val includeMetadata: Boolean = false
5+
val includeMetadata: Boolean = false,
6+
val isPersistent: Boolean = true
67
)

0 commit comments

Comments
 (0)