1

I have a react-native project that I created using create-react-native-app. I would like to play videos in this app. I tried react-native-video but it gave me the error

TypeError: undefined is not an object (evaluating '_reactNative.NativeModules.UIManager.RCTVideo.Constants')

I then tried using react-native-video-controls and it created the same error.

Other solutions seem to revolve around calling react-native link, but this doesn't work for a create-react-native-app app. Am I out of luck using react-native-video or is there another solution to avoiding this error?

Connor W
  • 101
  • 8
  • Welcome! It's always a good idea to include some code demonstrating what you've tried already, to give people trying to help you an idea of where you're up to and what might be wrong. Here's [a guide](https://stackoverflow.com/help/mcve). Cheers! – Rich Churcher Dec 15 '17 at 21:41

1 Answers1

2

create-react-native-app builds a react native app using Expo. When using expo I believe you can't bring in native modules, only use what they provide. So anything that tells you to do react-native-link won't work.

Using react-native-init will build you a bare react-native project in which you will be able to bring in native modules.

However expo does provide a video api you can use: https://docs.expo.io/versions/latest/sdk/video.html

Matt Aft
  • 8,742
  • 3
  • 24
  • 37