aboutsummaryrefslogtreecommitdiff
path: root/src/utils/camera.ts
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-07-19 17:50:57 -0400
committerGitHub <noreply@github.com>2021-07-19 17:50:57 -0400
commit38af199ef978806a85d072830510666e309c5cdb (patch)
tree65863409190b800f06993f51e115aae927734b63 /src/utils/camera.ts
parent9766c3b0b4764052d708dba2a20d9673230de9c7 (diff)
parent8f1ef72fab7ca8f9e7bc2069531116283bbe00fc (diff)
Merge pull request #517 from brian-tagg/tma990-volume-toggle
[TMA-990] Toggle Audio
Diffstat (limited to 'src/utils/camera.ts')
-rw-r--r--src/utils/camera.ts16
1 files changed, 15 insertions, 1 deletions
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),
+ );
+};