Search code examples
iosreact-nativeexpo-av

expo-av Video not showing up on iOS but working on Android


Video and video player is loading fine on Android, but on iOS nothing is rendered. I'm using Video from expo-av.

I tried adding height and width to the view , tried

 source={{ uri: post.videoURL + ".mp4" }}

as these solved the problem in other SO posts, but they didn't work for me. What else would you suggest?

let videoPlayerRef = useRef(null);
...
            <View>
              <Video
                ref={videoPlayerRef}
                style={{
                  width: 350,
                  height: 200,
                }}
                resizeMode={Video.RESIZE_MODE_COVER}
                shouldPlay={true}
                useNativeControls
                isLooping={false}
                usePoster
                rate={1.0}
                volume={1.0}
                isMuted={false}
                onPlaybackStatusUpdate={(videoStatus) =>
                  setVideoStatus(() => videoStatus)
                }
                source={{ uri: post.videoURL }}
              />
            </View>

Solution

  • The problem was video format. Check what video format is uploaded/ played, guys. The video I was trying to play on iOS was neither of these: .m4v, .mp4, and .mov . Also the videos I was trying to upload in my app were .mov and that also caused problems - they didn't upload