Skip to content

Commit df89001

Browse files
committed
fix: check
1 parent 58b95f2 commit df89001

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

package/src/components/Attachment/AudioAttachment.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { useAudioPlayer } from '../../hooks/useAudioPlayer';
99
import { Audio, Pause, Play } from '../../icons';
1010
import {
1111
PlaybackStatus,
12+
SDK,
1213
Sound,
1314
SoundReturnType,
1415
VideoPayloadData,
@@ -52,7 +53,7 @@ export const AudioAttachment = (props: AudioAttachmentProps) => {
5253
testID,
5354
} = props;
5455
const { changeAudioSpeed, pauseAudio, playAudio, seekAudio } = useAudioPlayer({ soundRef });
55-
const isExpoCLI = !Sound.Player && Sound.initializeSound;
56+
const isExpoCLI = SDK === 'stream-chat-expo';
5657

5758
/** This is for Native CLI Apps */
5859
const handleLoad = (payload: VideoPayloadData) => {

package/src/hooks/useAudioPlayer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Sound, SoundReturnType } from '../native';
1+
import { SDK, SoundReturnType } from '../native';
22

33
export type UseSoundPlayerProps = {
44
soundRef: React.MutableRefObject<SoundReturnType | null>;
@@ -11,7 +11,7 @@ export type UseSoundPlayerProps = {
1111
export const useAudioPlayer = (props: UseSoundPlayerProps) => {
1212
const { soundRef } = props;
1313

14-
const isExpoCLI = !Sound.Player && Sound.initializeSound;
14+
const isExpoCLI = SDK === 'stream-chat-expo';
1515

1616
const playAudio = async () => {
1717
if (isExpoCLI) {

0 commit comments

Comments
 (0)