react-native-media-meta icon indicating copy to clipboard operation
react-native-media-meta copied to clipboard

is it possible to use local URL ?

Open RZulfikri opened this issue 8 years ago • 8 comments

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.

RZulfikri avatar May 16 '17 14:05 RZulfikri

We can support this, maybe just change this line.

jhen0409 avatar Jun 05 '17 08:06 jhen0409

Hi

In which release are you planing to add the feature?

ChetnaMahajan2405 avatar Jun 22 '17 08:06 ChetnaMahajan2405

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

matthewng avatar Aug 24 '17 20:08 matthewng

@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.

cloudsafe avatar Aug 29 '17 04:08 cloudsafe

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

ilariowiz avatar Nov 08 '17 17:11 ilariowiz

I solved removing file:// from path

TESTED ONLY ON IOS SIMULATOR

ilariowiz avatar Nov 20 '17 17:11 ilariowiz

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.

mthahzan avatar Jan 09 '18 07:01 mthahzan

Thanks to @Ilario17.

removing file:// works on android as well.

FaisalAli19 avatar Jul 01 '19 07:07 FaisalAli19