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/screens/upload | |
| parent | 6c17a1b13912b3e52ae4301d5a4b0ce50ba5d31d (diff) | |
| parent | b06b93e77ca7ec1b1107c0a58dbc2dd370208ccf (diff) | |
Merge branch 'master' into tma962-moment-upload-progress-bar
# Conflicts:
# package.json
# yarn.lock
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 38450337..9a061a53 100644 --- a/src/screens/upload/EditMedia.tsx +++ b/src/screens/upload/EditMedia.tsx @@ -68,6 +68,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) { @@ -144,6 +147,7 @@ export const EditMedia: React.FC<EditMediaProps> = ({route, navigation}) => { callback(croppedURL); }, videoCrop, + !audioOn, ); } }; @@ -347,6 +351,7 @@ export const EditMedia: React.FC<EditMediaProps> = ({route, navigation}) => { onChangedEndpoints={(response: {start: number; end: number}) => setTrimEnds(response) } + muted={!audioOn} /> </View> </ReactNativeZoomableView> @@ -361,11 +366,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> |
