@@ -280,6 +280,7 @@ class ChewieController extends ChangeNotifier {
280
280
this .systemOverlaysAfterFullScreen = SystemUiOverlay .values,
281
281
this .deviceOrientationsAfterFullScreen = DeviceOrientation .values,
282
282
this .routePageBuilder,
283
+ this .progressIndicatorDelayMS,
283
284
}) : assert (
284
285
playbackSpeeds.every ((speed) => speed > 0 ),
285
286
'The playbackSpeeds values must all be greater than 0' ,
@@ -322,6 +323,7 @@ class ChewieController extends ChangeNotifier {
322
323
List <DeviceOrientation >? deviceOrientationsOnEnterFullScreen,
323
324
List <SystemUiOverlay >? systemOverlaysAfterFullScreen,
324
325
List <DeviceOrientation >? deviceOrientationsAfterFullScreen,
326
+ int ? bufferingProgressIndicatorDisplayDelayMS,
325
327
Widget Function (
326
328
BuildContext ,
327
329
Animation <double >,
@@ -331,50 +333,51 @@ class ChewieController extends ChangeNotifier {
331
333
routePageBuilder,
332
334
}) {
333
335
return ChewieController (
334
- videoPlayerController:
335
- videoPlayerController ?? this .videoPlayerController,
336
- optionsTranslation: optionsTranslation ?? this .optionsTranslation,
337
- aspectRatio: aspectRatio ?? this .aspectRatio,
338
- autoInitialize: autoInitialize ?? this .autoInitialize,
339
- autoPlay: autoPlay ?? this .autoPlay,
340
- startAt: startAt ?? this .startAt,
341
- looping: looping ?? this .looping,
342
- fullScreenByDefault: fullScreenByDefault ?? this .fullScreenByDefault,
343
- cupertinoProgressColors:
344
- cupertinoProgressColors ?? this .cupertinoProgressColors,
345
- materialProgressColors:
346
- materialProgressColors ?? this .materialProgressColors,
347
- placeholder: placeholder ?? this .placeholder,
348
- overlay: overlay ?? this .overlay,
349
- showControlsOnInitialize:
350
- showControlsOnInitialize ?? this .showControlsOnInitialize,
351
- showOptions: showOptions ?? this .showOptions,
352
- optionsBuilder: optionsBuilder ?? this .optionsBuilder,
353
- additionalOptions: additionalOptions ?? this .additionalOptions,
354
- showControls: showControls ?? this .showControls,
355
- subtitle: subtitle ?? this .subtitle,
356
- subtitleBuilder: subtitleBuilder ?? this .subtitleBuilder,
357
- customControls: customControls ?? this .customControls,
358
- errorBuilder: errorBuilder ?? this .errorBuilder,
359
- allowedScreenSleep: allowedScreenSleep ?? this .allowedScreenSleep,
360
- isLive: isLive ?? this .isLive,
361
- allowFullScreen: allowFullScreen ?? this .allowFullScreen,
362
- allowMuting: allowMuting ?? this .allowMuting,
363
- allowPlaybackSpeedChanging:
364
- allowPlaybackSpeedChanging ?? this .allowPlaybackSpeedChanging,
365
- useRootNavigator: useRootNavigator ?? this .useRootNavigator,
366
- playbackSpeeds: playbackSpeeds ?? this .playbackSpeeds,
367
- systemOverlaysOnEnterFullScreen: systemOverlaysOnEnterFullScreen ??
368
- this .systemOverlaysOnEnterFullScreen,
369
- deviceOrientationsOnEnterFullScreen:
370
- deviceOrientationsOnEnterFullScreen ??
371
- this .deviceOrientationsOnEnterFullScreen,
372
- systemOverlaysAfterFullScreen:
373
- systemOverlaysAfterFullScreen ?? this .systemOverlaysAfterFullScreen,
374
- deviceOrientationsAfterFullScreen: deviceOrientationsAfterFullScreen ??
375
- this .deviceOrientationsAfterFullScreen,
376
- routePageBuilder: routePageBuilder ?? this .routePageBuilder,
377
- );
336
+ videoPlayerController:
337
+ videoPlayerController ?? this .videoPlayerController,
338
+ optionsTranslation: optionsTranslation ?? this .optionsTranslation,
339
+ aspectRatio: aspectRatio ?? this .aspectRatio,
340
+ autoInitialize: autoInitialize ?? this .autoInitialize,
341
+ autoPlay: autoPlay ?? this .autoPlay,
342
+ startAt: startAt ?? this .startAt,
343
+ looping: looping ?? this .looping,
344
+ fullScreenByDefault: fullScreenByDefault ?? this .fullScreenByDefault,
345
+ cupertinoProgressColors:
346
+ cupertinoProgressColors ?? this .cupertinoProgressColors,
347
+ materialProgressColors:
348
+ materialProgressColors ?? this .materialProgressColors,
349
+ placeholder: placeholder ?? this .placeholder,
350
+ overlay: overlay ?? this .overlay,
351
+ showControlsOnInitialize:
352
+ showControlsOnInitialize ?? this .showControlsOnInitialize,
353
+ showOptions: showOptions ?? this .showOptions,
354
+ optionsBuilder: optionsBuilder ?? this .optionsBuilder,
355
+ additionalOptions: additionalOptions ?? this .additionalOptions,
356
+ showControls: showControls ?? this .showControls,
357
+ subtitle: subtitle ?? this .subtitle,
358
+ subtitleBuilder: subtitleBuilder ?? this .subtitleBuilder,
359
+ customControls: customControls ?? this .customControls,
360
+ errorBuilder: errorBuilder ?? this .errorBuilder,
361
+ allowedScreenSleep: allowedScreenSleep ?? this .allowedScreenSleep,
362
+ isLive: isLive ?? this .isLive,
363
+ allowFullScreen: allowFullScreen ?? this .allowFullScreen,
364
+ allowMuting: allowMuting ?? this .allowMuting,
365
+ allowPlaybackSpeedChanging:
366
+ allowPlaybackSpeedChanging ?? this .allowPlaybackSpeedChanging,
367
+ useRootNavigator: useRootNavigator ?? this .useRootNavigator,
368
+ playbackSpeeds: playbackSpeeds ?? this .playbackSpeeds,
369
+ systemOverlaysOnEnterFullScreen: systemOverlaysOnEnterFullScreen ??
370
+ this .systemOverlaysOnEnterFullScreen,
371
+ deviceOrientationsOnEnterFullScreen:
372
+ deviceOrientationsOnEnterFullScreen ??
373
+ this .deviceOrientationsOnEnterFullScreen,
374
+ systemOverlaysAfterFullScreen:
375
+ systemOverlaysAfterFullScreen ?? this .systemOverlaysAfterFullScreen,
376
+ deviceOrientationsAfterFullScreen: deviceOrientationsAfterFullScreen ??
377
+ this .deviceOrientationsAfterFullScreen,
378
+ routePageBuilder: routePageBuilder ?? this .routePageBuilder,
379
+ progressIndicatorDelayMS: bufferingProgressIndicatorDisplayDelayMS ??
380
+ this .progressIndicatorDelayMS);
378
381
}
379
382
380
383
/// If false, the options button in MaterialUI and MaterialDesktopUI
@@ -505,6 +508,9 @@ class ChewieController extends ChangeNotifier {
505
508
/// Defines a custom RoutePageBuilder for the fullscreen
506
509
final ChewieRoutePageBuilder ? routePageBuilder;
507
510
511
+ /// [Android] Defines a delay in milliseconds between entering buffering state and displaying the loading spinner. Set null (default) to disable it.
512
+ final int ? progressIndicatorDelayMS;
513
+
508
514
static ChewieController of (BuildContext context) {
509
515
final chewieControllerProvider =
510
516
context.dependOnInheritedWidgetOfExactType <ChewieControllerProvider >()! ;
0 commit comments