justsoft / video_thumbnail

This plugin generates thumbnail from video file or URL. It returns image in memory or writes into a file. It offers rich options to control the image format, resolution and quality. Supports iOS and Android.
MIT License
183 stars 238 forks source link

Run platform code on background thread in Android #93

Open emvaized opened 2 years ago

emvaized commented 2 years ago

In my case video_thumbnail causes UI freezes when app fetches 20+ thumbnails simultaniously.

When expecting platform code, I found these lines: https://github.com/justsoft/video_thumbnail/blob/a915b3b9ef80075ee2e0e6332e9bf5eccc7495b7/android/src/main/java/xyz/justsoft/video_thumbnail/VideoThumbnailPlugin.java#L163 https://github.com/justsoft/video_thumbnail/blob/a915b3b9ef80075ee2e0e6332e9bf5eccc7495b7/android/src/main/java/xyz/justsoft/video_thumbnail/VideoThumbnailPlugin.java#L183

Does this mean that video_thumbnail runs it's platform code on the main UI thread? Or do I miss something?