Skip to content

Commit f59d7be

Browse files
audio type checking added,MRN-869
1 parent 164ccc0 commit f59d7be

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

src/Media/VideoPlayer.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from 'react';
33
import { BackHandler, Platform, StyleSheet, View } from 'react-native';
44
import Video from 'react-native-video';
55
import IconButton from '../common/IconButton';
6-
import { AudioMusicIcon, BackArrowIcon } from '../common/Icons';
6+
import { AudioMicIcon, AudioMusicIcon, BackArrowIcon } from '../common/Icons';
77
import { useAppState } from '../common/hooks';
88
import { showToast } from '../helpers/chatHelpers';
99
import commonStyles from '../styles/commonStyles';
@@ -14,6 +14,7 @@ const VideoPlayer = () => {
1414
params: {
1515
item: { fileDetails = {} },
1616
audioOnly = false,
17+
audioType,
1718
},
1819
} = useRoute();
1920
const navigation = useNavigation();
@@ -160,7 +161,7 @@ const VideoPlayer = () => {
160161
<View style={[commonStyles.flex1, commonStyles.justifyContentCenter]}>
161162
{audioOnly && (
162163
<View style={[commonStyles.flex1, commonStyles.justifyContentCenter, commonStyles.alignItemsCenter]}>
163-
<AudioMusicIcon width={200} height={200} />
164+
{audioType ? <AudioMicIcon width={200} height={200} /> : <AudioMusicIcon width={200} height={200} />}
164165
</View>
165166
)}
166167
<Video

src/common/VideoInfo.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useNavigation } from '@react-navigation/native';
22
import React from 'react';
33
import { I18nManager, Image, Platform, StyleSheet, View } from 'react-native';
44
import RNConvertPhAsset from 'react-native-convert-ph-asset';
5-
import { AudioMusicIcon, PlayIcon } from '../common/Icons';
5+
import { AudioMicIcon, AudioMusicIcon, PlayIcon } from '../common/Icons';
66
import Pressable from '../common/Pressable';
77
import { getThumbBase64URL } from '../helpers/chatHelpers';
88
import { useThemeColorPalatte } from '../redux/reduxHook';
@@ -15,6 +15,8 @@ const VideoInfo = props => {
1515
const themeColorPalatte = useThemeColorPalatte();
1616
const { item: galleryItem = {}, selectedMedia = {}, audioOnly = false } = props;
1717
const SingleSelectedImage = selectedMedia.media;
18+
const audioType = selectedMedia.media?.audioType;
19+
1820
let item = galleryItem;
1921
if (SingleSelectedImage?.local_path) {
2022
item = {
@@ -52,14 +54,14 @@ const VideoInfo = props => {
5254
}, []);
5355

5456
const handleVideoPlayButton = () => {
55-
navigation.navigate(VIDEO_PLAYER_SCREEN, { item, audioOnly });
57+
navigation.navigate(VIDEO_PLAYER_SCREEN, { item, audioOnly, audioType });
5658
};
5759

5860
return (
5961
<View style={[styles.player, audioOnly ? styles.audioOnly : styles.video]}>
6062
{audioOnly && (
6163
<View style={[commonStyles.flex1, commonStyles.justifyContentCenter, commonStyles.alignItemsCenter]}>
62-
<AudioMusicIcon width={200} height={200} />
64+
{audioType ? <AudioMicIcon width={200} height={200} /> : <AudioMusicIcon width={200} height={200} />}
6365
</View>
6466
)}
6567
<Pressable

src/components/MediaTab.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useNavigation } from '@react-navigation/native';
22
import React, { useCallback, useMemo } from 'react';
33
import { ActivityIndicator, Dimensions, FlatList, Image, StyleSheet, View } from 'react-native';
4-
import { AudioWhileIcon, PlayIcon } from '../common/Icons';
4+
import { AudioMicIcon, AudioMusicIcon, PlayIcon } from '../common/Icons';
55
import Pressable from '../common/Pressable';
66
import Text from '../common/Text';
77
import { getThumbBase64URL } from '../helpers/chatHelpers';
@@ -51,7 +51,10 @@ const MediaTab = ({ chatUserId, jid }) => {
5151
const {
5252
deleteStatus = 0,
5353
recallStatus = 0,
54-
msgBody: { media: { thumb_image = '', is_downloaded, is_uploading } = {}, message_type = '' } = {},
54+
msgBody: {
55+
media: { thumb_image = '', is_downloaded, is_uploading, audioType } = {},
56+
message_type = '',
57+
} = {},
5558
} = item;
5659

5760
if (deleteStatus !== 0 || recallStatus !== 0 || is_downloaded !== 2 || is_uploading !== 2) {
@@ -96,7 +99,11 @@ const MediaTab = ({ chatUserId, jid }) => {
9699
styles.audioTile,
97100
{ width: tileSize - 4, height: tileSize - 4 },
98101
]}>
99-
<AudioWhileIcon />
102+
{audioType ? (
103+
<AudioMicIcon width="31.409" height="23.746" fill="#fff" />
104+
) : (
105+
<AudioMusicIcon width="31.409" height="23.746" color="#fff" />
106+
)}
100107
</View>
101108
);
102109
}

0 commit comments

Comments
 (0)