Reputation: 35
I'm using better_player package for list of videos in my application. The package is providing the preCache method which cache the video. So just a quick question can i run this method in separate isolate so my UI thread work smoothly. Or isolates have some restrictions?
Upvotes: 0
Views: 85
Reputation: 2780
There is no restrictions from dart side to use plugins inside isolates, but there is caveat described in this question and answer to it: Flutter resize and compress image in Isolate throws UnimplementedError
TLDR; you can use flutter plugins in isolates, but you should use more low-level APIs for isolates there, since it's obligatory to initiate BackgroundIsolateBinaryMessenger first.
Good news is that you don't have to use isolates at all! Reason for this: this plugin delegates caching operations to platform implementations and these implementations handle I/O and asynchronous operations itself:
So, you can just use preCache
method in your code and not be worried about performance.
Upvotes: 0