From e9b1dba10f0bc691d2ce49af7c079ec33e329d2b Mon Sep 17 00:00:00 2001 From: Brian Kim Date: Mon, 19 Jul 2021 15:05:22 -0400 Subject: Added basic functionality for audio removal --- src/utils/camera.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/utils') diff --git a/src/utils/camera.ts b/src/utils/camera.ts index 9d7ff67f..c3822858 100644 --- a/src/utils/camera.ts +++ b/src/utils/camera.ts @@ -130,6 +130,7 @@ export const cropVideo = ( cropOffsetX?: number; cropOffsetY?: number; }, + muted?: boolean, ) => { ProcessingManager.crop(sourceUri, { cropWidth: videoCropValues @@ -154,6 +155,19 @@ export const cropVideo = ( : 0, quality: 'highest', }).then((data: any) => { - handleData(data); + if (muted) { + removeAudio(data, handleData); + } else { + handleData(data); + } }); }; + +export const removeAudio = ( + sourceUri: string, + handleData: (data: any) => any, +) => { + ProcessingManager.compress(sourceUri, {removeAudio: true}).then((data: any) => + handleData(data), + ); +}; -- cgit v1.2.3-70-g09d2