1

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>
Simona
  • 53
  • 1
  • 12

2 Answers2

2

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

Simona
  • 53
  • 1
  • 12
  • 1
    thanks, I was having some strange issues with playback on Android and this helped. I converted my video to H.264 MP4, which plays well on both platforms. – Abe May 10 '22 at 03:50
  • 1
    Actually, I have checked the video formats and all of them are `.mp4`. Any other ideas for this issue? – Emad Baqeri Sep 03 '22 at 14:00
  • 1
    I have the same issue (no video or controls) and have tried .mp4, .mp3, and .m4v files. I know it has something to do with my server because when I put in a big buck bunny URL (https://d23dyxeqlo5psv.cloudfront.net/big_buck_bunny.mp4) it works fine. I even uploaded that exact video to my server and it still doesn't work. I thought it might be because my server doesn't use file extensions but I modified it to support that and still nothing. – Matthew Kline Sep 27 '22 at 16:15
1

I had the same issue with ios version, but my problem was the name of the files, when I removed the spaces from the name everything worked fine.

MertHaddad
  • 447
  • 1
  • 7
  • 15