0

I want to show video from device video gallery. I get response from react-native-image-picker that include path and content. When I use the content for display video with react-native-video component shows nothing.

I tried these codes

RN-image-picker response here.

Video component in render

1 static uri

 <Video
            source={{ uri: "content://media/external/video/media/23" }}
            repeat={true}
            style={styles.video}
            resizeMode="cover"
          />

2 static uri

 <Video
            source={{ uri: "content://media/external/video/media/23" }}
            repeat={true}
            style={styles.video}
            resizeMode="cover"
          />

3

openGallery = () => {
    ImagePicker.launchImageLibrary(options, response => {
      if (response.didCancel) {
        //console.warn("User cancelled image picker");
      } else if (response.error) {
        //console.warn("ImagePicker Error: ", response.error);
      } else {
        this.setState({
          uri: response.uri,
        });
      }
    });
  };

 <Video
            source={{ uri: this.state.uri }}
            repeat={true}
            style={styles.video}
            resizeMode="cover"
          />

I have one video on device

Video component shows nothing.
react-native : 0.59.10
react-native-video : ^4.4.4
react-native-image-picker: ^0.27.2

Edgar
  • 6,022
  • 8
  • 33
  • 66
MertN
  • 1
  • 1

1 Answers1

0

I don't think it's supported yet. Among the contents of the official document...

The following other types are supported on some platforms, but aren't fully documented yet: content://, ms-appx://, ms-appdata://, assets-library://

hong developer
  • 13,291
  • 4
  • 38
  • 68
  • I have using the content from documentpicker and write path with "content://" and the video can play even though it mention in the react-native-video document. OP source is not having the file type. I've select video file from DocumentPicker and the final path is having encoded "%2FSamplevideo.wmv" and the last backslash. But the video can be play without problem. – Luiey Dec 18 '19 at 03:13