Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To play a video from the C:/ directory using React Native Windows, you can use the Video component provided by React Native.

Firstly, you will need to import the Video component from the react-native-video package:

import Video from 'react-native-video';

Then, you can render the video component with the source set to the local file path:

<Video source={{uri: 'file:///C:/path/to/video.mp4'}} />

Make sure to replace the file path with the correct path to your video file.

Additionally, you may wish to adjust the video's height, width, and other settings:

<Video
  source={{uri: 'file:///C:/path/to/video.mp4'}}
  style={{width: '100%', height: 'auto'}}
  resizeMode="contain"
  controls={true}
/>

This example sets the video to fill the width of its container and adjust its height automatically, uses the "contain" resize mode, and shows video playback controls.