react-nativereact-native-windows

React Native Windows: play a video from C:/


I'm trying to play a video from my local storage (C:/) in my ReactNative Windows app. I've tried the following to no avail:

RootRoute\node_modules\react-native-file-viewer\windows\RNFileViewer\RNFileViewerModule.cs(1,7): error CS0246: The type or namespace name 'ReactNative' could not be found (are you missing a using directive or an assembly reference?) [RootRoute\node_modules\react-native-file-viewer\windows\RNFileViewer\RNFileViewer.csproj]. Check your build configuration.

Any help would be greatly appreciated.


Solution

  • I was able to solve it by copying the video to my local app folder and using the library react-native-video.

    The property RNFS.DocumentDirectoryPath is a local AppData folder which you can user to store the video and read it with file:// directive in a <Video/> tag.