phuochau / react-native-thumbnail

Get thumbnail from local media. Currently, it only supports for video.
MIT License
135 stars 104 forks source link

How should the filepath be? #29

Closed ronastlelobo closed 6 years ago

ronastlelobo commented 6 years ago

I am using react-native-document-picker. I get the file path using the res object, res.uri give me file path in the form of content://com.android.providers.media.documents/document/video%xxxxxxx. On giving this file path to RNThumbnail.get(res.uri) my app crashes. I don't know whether there is problem with uri or anything else.

nitinkumar24 commented 6 years ago

@ronastlelobo Did you find any solution?

ronastlelobo commented 6 years ago

No

nitinkumar24 commented 6 years ago

You can use RnFetchBlob to get the exact path of an image. RNFetchBlob.fs .stat(uri) .then(stats => { filepath = stats.path; console.log(filepath); })

heyman333 commented 6 years ago

you have to use local file url that init with file:// you can use rn-fetch-blob' or 'react-native-real-path