diff options
author | Ivan Chen <ivan@tagg.id> | 2021-07-16 15:48:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-16 15:48:31 -0400 |
commit | 6161a73ec29dbcf4ffb9ee90d86a3c4e46eb58dc (patch) | |
tree | ed8b2fb574e598f25d1db0e0204504ebe472924b /src/utils/camera.ts | |
parent | 0838a170c84c32d502377c17825d7bf8d21300d0 (diff) | |
parent | 580774b43f2919c4fb4230308afb06cc9891a5e9 (diff) |
Merge pull request #503 from sotech117/tma954-video-trimming-component
[TMA-954] Video Trimming Component
Diffstat (limited to 'src/utils/camera.ts')
-rw-r--r-- | src/utils/camera.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/utils/camera.ts b/src/utils/camera.ts index c0b0c6bf..5485b1ca 100644 --- a/src/utils/camera.ts +++ b/src/utils/camera.ts @@ -103,6 +103,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, |