2

I want to get media file (video/audio) file metadata to get file duration for that I'm using "react-native-media-meta" library and it is working perfectly on Android. But on iOS, it is not working. Kindly help.

ImagePicker.showImagePicker(
  { title: "Pick a File", mediaType: "video", takePhotoButtonTitle:'' },
    async res => {
        if (res.didCancel) {
        } else if (res.error) {
          console.log("error: ", res.error);
        } else {
          const source = { uri: res.uri };
          if(fileType == 'video'){
            if(Platform.OS === 'ios'){
              const path = res.uri.substring(7) // for ios
               MediaMeta.get(path)
              .then(metadata => {
                console.log("metadata: ", metadata);
              });
            }
          }
        }
    }
);
Or Assayag
  • 5,662
  • 13
  • 57
  • 93
Naresh Pawar
  • 179
  • 2
  • 3
  • 15

0 Answers0