Preloading logic to reduce video initialization using isolate to fetch videos in the background so that the video experience is not disturbed.
Without the use of isolate, the video will be paused whenever there is an API call because the main thread will be busy fetching new video URLs.
More about isolate: π https://blog.codemagic.io/understanding-flutter-isolates/
To clone and run this application, you'll need git and flutter installed on your computer. From your command line:
# Clone this repository
$ git clone https://github.com/Shadow60539/flutter_preload_videos.git
# Go into the repository
$ cd flutter_preload_videos
# Install dependencies
$ flutter packages get
# Run the app
$ flutter run
Package | Description |
---|---|
video_player | Render videos in Flutter |
build_runner | Build Custom Models |
flutter_bloc | BLoC State Management |
freezed | Code generation for immutable classes |
The project directory structure is as follows:
βββ android
βββ asset
βββ build
βββ images
βββ ios
βββ lib
βββ test
βββ analysis_options.yaml
βββ pubspec.lock
βββ pubspec.yaml