Skip to content

Commit 358bcc2

Browse files
committed
fix: add check for audio component
1 parent 2a2f87a commit 358bcc2

File tree

1 file changed

+5
-3
lines changed
  • package/expo-package/src/optionalDependencies

1 file changed

+5
-3
lines changed

package/expo-package/src/optionalDependencies/Video.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ export const Video = videoPackage
5151
// This is done so that the audio of the video is not muted when the phone is in silent mode for iOS.
5252
useEffect(() => {
5353
const initializeSound = async () => {
54-
await AudioComponent.setAudioModeAsync({
55-
playsInSilentModeIOS: true,
56-
});
54+
if (AudioComponent) {
55+
await AudioComponent.setAudioModeAsync({
56+
playsInSilentModeIOS: true,
57+
});
58+
}
5759
};
5860
initializeSound();
5961
}, []);

0 commit comments

Comments
 (0)