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/screens/upload/EditMedia.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/screens') diff --git a/src/screens/upload/EditMedia.tsx b/src/screens/upload/EditMedia.tsx index 1dc408ee..f9b17d0b 100644 --- a/src/screens/upload/EditMedia.tsx +++ b/src/screens/upload/EditMedia.tsx @@ -67,6 +67,9 @@ export const EditMedia: React.FC = ({route, navigation}) => { start: 0, }); + // Stores audio on/off information + const [audioOn, setAudioOn] = useState(true); + // Setting original aspect ratio of image useEffect(() => { if (mediaUri && !isVideo) { @@ -143,6 +146,7 @@ export const EditMedia: React.FC = ({route, navigation}) => { callback(croppedURL); }, videoCrop, + !audioOn, ); } }; @@ -342,6 +346,7 @@ export const EditMedia: React.FC = ({route, navigation}) => { onChangedEndpoints={(response: {start: number; end: number}) => setTrimEnds(response) } + muted={!audioOn} /> @@ -357,10 +362,14 @@ export const EditMedia: React.FC = ({route, navigation}) => { null}> + onPress={() => setAudioOn((state) => !state)}> Volume -- cgit v1.2.3-70-g09d2