diff options
author | Ivan Chen <ivan@tagg.id> | 2021-07-19 17:50:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-19 17:50:57 -0400 |
commit | 38af199ef978806a85d072830510666e309c5cdb (patch) | |
tree | 65863409190b800f06993f51e115aae927734b63 /src/screens/upload | |
parent | 9766c3b0b4764052d708dba2a20d9673230de9c7 (diff) | |
parent | 8f1ef72fab7ca8f9e7bc2069531116283bbe00fc (diff) |
Merge pull request #517 from brian-tagg/tma990-volume-toggle
[TMA-990] Toggle Audio
Diffstat (limited to 'src/screens/upload')
-rw-r--r-- | src/screens/upload/EditMedia.tsx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/screens/upload/EditMedia.tsx b/src/screens/upload/EditMedia.tsx index 1dc408ee..f8e7692d 100644 --- a/src/screens/upload/EditMedia.tsx +++ b/src/screens/upload/EditMedia.tsx @@ -67,6 +67,9 @@ export const EditMedia: React.FC<EditMediaProps> = ({route, navigation}) => { start: 0, }); + // Stores audio on/off information + const [audioOn, setAudioOn] = useState<boolean>(true); + // Setting original aspect ratio of image useEffect(() => { if (mediaUri && !isVideo) { @@ -143,6 +146,7 @@ export const EditMedia: React.FC<EditMediaProps> = ({route, navigation}) => { callback(croppedURL); }, videoCrop, + !audioOn, ); } }; @@ -342,6 +346,7 @@ export const EditMedia: React.FC<EditMediaProps> = ({route, navigation}) => { onChangedEndpoints={(response: {start: number; end: number}) => setTrimEnds(response) } + muted={!audioOn} /> </View> </ReactNativeZoomableView> @@ -356,11 +361,14 @@ export const EditMedia: React.FC<EditMediaProps> = ({route, navigation}) => { </TouchableOpacity> <TouchableOpacity style={styles.iconContainer} - // TODO: finish me - onPress={() => null}> + onPress={() => setAudioOn((state) => !state)}> <Image style={styles.volumnIcon} - source={require('../../assets/images/volume-on.png')} + source={ + audioOn + ? require('../../assets/images/volume-on.png') + : require('../../assets/images/volume-off.png') + } /> <Text style={styles.iconText}>Volume</Text> </TouchableOpacity> |