phuochau / react-native-thumbnail

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

Android failing #5

Closed bz123 closed 6 years ago

bz123 commented 6 years ago

I am using version 7.1 on android and I get this error

Attempt to invoke virtual method 'boolean android.graphics.Bitmap.compress(android.graphics.Bitmap$CompressFormat, int, java.io.OutputStream)' on a null object reference Error: Attempt to invoke virtual method 'boolean android.graphics.Bitmap.compress(android.graphics.Bitmap$CompressFormat, int, java.io.OutputStream)' on a null object reference

The path am passing on it looks like this : file:///storage/emulated/0/Movies/VID_20170930_062218.mp4 any ideas?

bz123 commented 6 years ago

Hmm :/ seems its my code. I needed to add a timeout on when the user can stop recording until the path is set.

gatlin commented 6 years ago

@bz123 I'm actually running into this exact same error. How did you resolve it, exactly?

edvardchen commented 5 years ago

Maybe @gatlin you already had a solution? I would still share my experience. I encountered this exact same issue today. I used this library to capture the thumbnail from the video recorded by react-native-video. When I stop recording quickly, this error would be thrown.

So we need to prevent that. Check the recording time before stop recoding.