Not able to get Metadata using react-native-media-meta library for ios

711 Views Asked by At

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);
              });
            }
          }
        }
    }
);
0

There are 0 best solutions below