flutter_preload_videos icon indicating copy to clipboard operation
flutter_preload_videos copied to clipboard

short flickering between the videos

Open desmeit opened this issue 1 year ago • 0 comments

I try to adjust your code to a version with provider. Unfortunately I get a short flickering between the videos.

  return videoService != null && videoService!.focusedIndex == index
                  ? VideoWidget(
                      isLoading: _isLoading,
                      controller: videoService!.controllers[index]!,
                    )
                  : Container(color: Colors.yellow);

https://github.com/Shadow60539/flutter_preload_videos/assets/9454529/45c5dc11-4b8d-4c99-87e9-30ab519bc9d1

if I remove the videoService!.focusedIndex == index then it is working smoothless but then I have a dispose issue. As I understand the Container (or the empty Sizebox in your code) appears as long as the focusedIndex is not the index. Then you always have this short interruption between the videos, regardless of the loading of the video? how can I prevent this flicker between the videos? maybe it is possible not to check for focusedIndex and dispose all controllers together at the end?

I have an additional question: Why did you put the createIsolate function in the main file? can't you call it in the preload_bloc file? Is it important to do it in the main file?

desmeit avatar Jun 30 '23 10:06 desmeit