-1

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?

1 Answer 1

1

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:

  1. WorkManager used on Android, source code
  2. URLSession used on iOS and it handles non-blocking download itself internally, source code

So, you can just use preCache method in your code and not be worried about performance.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.