diff options
author | Ivan Chen <ivan@tagg.id> | 2021-07-22 19:14:00 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-07-22 19:14:00 -0400 |
commit | 40fb142271a59b4a6f39f8995948e25dc21fe176 (patch) | |
tree | e093a54db2b5f60e65b64860a0c1dc1da4dd6ccc /src/utils/camera.ts | |
parent | 6c17a1b13912b3e52ae4301d5a4b0ce50ba5d31d (diff) | |
parent | b06b93e77ca7ec1b1107c0a58dbc2dd370208ccf (diff) |
Merge branch 'master' into tma962-moment-upload-progress-bar
# Conflicts:
# package.json
# yarn.lock
Diffstat (limited to 'src/utils/camera.ts')
-rw-r--r-- | src/utils/camera.ts | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/utils/camera.ts b/src/utils/camera.ts index 97592fe5..8104ba74 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), + ); +}; |