aboutsummaryrefslogtreecommitdiff
path: root/src/utils/camera.ts
diff options
context:
space:
mode:
authorMichael <michael.foiani@gmail.com>2021-07-15 16:42:10 -0400
committerMichael <michael.foiani@gmail.com>2021-07-15 16:42:10 -0400
commit05c79b11815e6544e9066aeed09199c6074f480b (patch)
treeadf98c0f62335d331ef624f603a08464b947da9d /src/utils/camera.ts
parenteed51412f523cd661a2081147c7b1b0591732973 (diff)
Incorporate trimming into the old moment flow with the cropping functionality.
Diffstat (limited to 'src/utils/camera.ts')
-rw-r--r--src/utils/camera.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/utils/camera.ts b/src/utils/camera.ts
index 9e37d62e..5c7f5ee0 100644
--- a/src/utils/camera.ts
+++ b/src/utils/camera.ts
@@ -118,6 +118,21 @@ export const showGIFFailureAlert = (onSuccess: () => void) =>
},
);
+export const trimVideo = (
+ sourceUri: string,
+ handleData: (data: any) => any,
+ ends: {
+ start: number;
+ end: number;
+ },
+) => {
+ ProcessingManager.trim(sourceUri, {
+ startTime: ends.start / 2, //needed divide by 2 for bug in module
+ endTime: ends.end,
+ quality: 'passthrough',
+ }).then((data: any) => handleData(data));
+};
+
export const cropVideo = (
sourceUri: string,
handleData: (data: any) => any,