Bhavani Mandapati
Bhavani Mandapati

Reputation: 207

Not able to play video.how to access a video path which is there in Downloads of Files in Android emulator

I drag and dropped my samplevideos folder into emulator then the file was available at Files/Downloads in emulator.

I was trying to access one of the video file from samplevideos file into my react native code

<Video source={{uri:"file:///Files:/Downloads/samplevideos/1.mp4"}}
          volume={50}
          resizeMode="cover"
          style={styles.videoStyle}
  />

files folder screen shot sample videos screen shot

Upvotes: 0

Views: 243

Answers (1)

hong developer
hong developer

Reputation: 13926

You can use rn-fetch-blob

dirs - This constant is a hash map containing commonly used folders:

Usage

const dirs = RNFetchBlob.fs.dirs
const filePath = `${dirs.DownloadDir}/samplevideos/1.mp4`
<Video source={{uri: filePath }}
          volume={50}
          resizeMode="cover"
          style={styles.videoStyle}
  />

Upvotes: 1

Related Questions