mybigday / react-native-media-meta

Get media file metadata in your React Native app
MIT License
83 stars 46 forks source link

is it possible to use local URL ? #5

Open RZulfikri opened 7 years ago

RZulfikri commented 7 years ago

hi, i have IOS uri/local url from cameraRoll react native, can i use it ? because i always get error using that ? can you tell me path of ios file..

thanks.

jhen0409 commented 7 years ago

We can support this, maybe just change this line.

ChetnaMahajan2405 commented 7 years ago

Hi

In which release are you planing to add the feature?

matthewng commented 7 years ago

Could you explain how your would change that line? Right now my asset-libary://asset URLs are returning file not found. Thanks.

cloudsafe commented 7 years ago

@matthewng hi, Have you solved your problem?I have the same problem, I copy the video from the asset-libary://asset URLs and get the first frame, in simulator,it's works well,but in my phone,it's failed.

Ilario17 commented 6 years ago

Hi,

same issue.. I'm using react-native-image-crop-picker to pick a video

ImagePicker.openPicker({
   mediaType: 'video',
}).then((video) => {
   console.log(video);
   console.log(video.path);
   MediaMeta.get(video.path)
      .then(metadata => console.log(metadata))
      .catch(error => console.log(error));
   this.onChangeData('video', video);
});

video.path is valid because I can upload the video with this path file:///Users/Ilario/Library/Developer/CoreSimulator/Devices/4D446481-F623-4B2C-A812-33F0C09D21EB/data/Containers/Data/Application/AE2670F1-91F4-42A8-A9FD-F6D5BC5A8C93/tmp/react-native-image-crop-picker/D2A02363-D4C0-4464-8981-AE51EAA04FD0.mp4

but MediaMeta return Cannot read property 'get' of undefined

Ilario17 commented 6 years ago

I solved removing file:// from path

TESTED ONLY ON IOS SIMULATOR

mthahzan commented 6 years ago

It always throws a File not found error on Android. My file path is like content://com.google.android.apps.contentproviders/....

EDIT My bad. Using a path instead of a URI works as expected.

FaisalAli19 commented 5 years ago

Thanks to @Ilario17.

removing file:// works on android as well.