فهرست منبع

Do not initialize twice

Ben Hagen 6 سال پیش
والد
کامیت
a16cabdcaf
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      lib/src/chewie_controller.dart

+ 2 - 1
lib/src/chewie_controller.dart

@@ -79,7 +79,8 @@ class ChewieController extends ChangeNotifier {
   Future _initialize() async {
     await videoPlayerController.setLooping(looping);
 
-    if (autoInitialize || autoPlay) {
+    if ((autoInitialize || autoPlay) &&
+        !videoPlayerController.value.initialized) {
       await videoPlayerController.initialize();
     }