From 05c79b11815e6544e9066aeed09199c6074f480b Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 15 Jul 2021 16:42:10 -0400 Subject: Incorporate trimming into the old moment flow with the cropping functionality. --- src/utils/camera.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/utils') 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, -- cgit v1.2.3-70-g09d2