diff --git a/package/expo-package/src/handlers/Video.tsx b/package/expo-package/src/handlers/Video.tsx index c989c60a72..29407e9071 100644 --- a/package/expo-package/src/handlers/Video.tsx +++ b/package/expo-package/src/handlers/Video.tsx @@ -1,16 +1,30 @@ -import { VideoComponent } from '../optionalDependencies'; +import React, { useEffect } from 'react'; + +import { AudioComponent, VideoComponent } from '../optionalDependencies'; export const Video = VideoComponent - ? ({ onPlaybackStatusUpdate, paused, resizeMode, style, uri, videoRef }) => ( - - ) + ? ({ onPlaybackStatusUpdate, paused, resizeMode, style, uri, videoRef }) => { + // This is done so that the audio of the video is not muted when the phone is in silent mode for iOS. + useEffect(() => { + const initializeSound = async () => { + await AudioComponent.setAudioModeAsync({ + playsInSilentModeIOS: true, + }); + }; + initializeSound(); + }, []); + + return ( + + ); + } : null;