Skip to content
This repository has been archived by the owner on Dec 2, 2019. It is now read-only.

Android setDataSource Error #9

Open
ghost opened this issue Oct 30, 2017 · 11 comments
Open

Android setDataSource Error #9

ghost opened this issue Oct 30, 2017 · 11 comments

Comments

@ghost
Copy link

ghost commented Oct 30, 2017

I have got the thumbnail on IOS successfully, but on android getting this error:
Note: i try it on android version 4.4 and android 7.0 => { the same error }
Can anyone help me?

screenshot_2017-10-30-10-49-11-194

@Hulva
Copy link

Hulva commented Nov 2, 2017

+1

1 similar comment
@facuacostag
Copy link

+1

@iosley
Copy link

iosley commented Nov 17, 2017

same problem

@phuochau
Copy link
Owner

Sorry for late response, has a little bit busy, I will fix this error within next week and will release new version soon

@duckysan
Copy link

Hello, were you able to fix this error ?
Thanks a lot !

@stitovich
Copy link

stitovich commented Dec 20, 2017

I have the same error when using with ImagePicker (https://github.com/react-community/react-native-image-picker) when trying to get preview for image from camera.
This component returns uri that starts with "file:///storage/other_path" when i am trying to choose an image from library.
As i see "file://" is removed from path by this line:
https://github.com/phuochau/react-native-thumbnail/blob/master/android/src/main/java/com/reactlibrary/RNThumbnailModule.java#L42
But when you trying to take video from camera uri begins with "content://other-path". So it was a cause of problem in my case. I just pass a path instead of uri from ImagePicker response.
So according to issue (https://stackoverflow.com/questions/17629995/android-mediametadataretriever-setdatasource-failed/32747923#32747923)
I think maybe problem in incorrect path. Just try to check that path that you pass to RNThumbnail.get looks something like:
"file:///long_long_path/filename.extension" or "/long_long_path/filename.extension".
I am not specialist in android but hope this helps.

@brainahdev
Copy link

Hi, I too facing the same issue when I provide the data source video as external URL (video from server). When I provide the local storage it works and get video thumb like file:///storage/emulated/0/thumb/thumb-a3dd2a81-83b5-4dc8-aaa7-dd77a6a9f704.jpeg

@jaspervanbrian
Copy link

Hello, I'm getting the same error. Is there a solution for this?

@bsp003
Copy link

bsp003 commented Jul 12, 2019

Check permissions of the app for storage access. Either ask programmatically or navigate to settings and enable.

@traxx10
Copy link

traxx10 commented Nov 27, 2019

Grant storage permission on android and it would go away

@souvik-ghosh
Copy link

souvik-ghosh commented Nov 29, 2019

This issue comes up when the file is incomplete, corrupted, there is no write permission or something like that. actually the MediaMetadataRetriever.setDataSource(...) throws the exception, which is not being handled currently. So the app crashes. the simplest work around I've found is to put the setDataSource(...) call inside try-catch. @phuochau I've raised the PR; please have a look - #53

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests