Skip to content

Commit 981cd13

Browse files
committed
Merge commit '75085dccc419afa0329fc20e007c9299b38663ed' into github/custom-lg
* commit '75085dccc419afa0329fc20e007c9299b38663ed': chewie, version 1.8.4. Addresses Issue fluttercommunity#838. Add bufferingBuilder
2 parents ba00f80 + 75085dc commit 981cd13

File tree

6 files changed

+22
-10
lines changed

6 files changed

+22
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## [1.8.4]
2+
* 🛠️ [#838](https://github.com/fluttercommunity/chewie/pull/838): Add bufferingBuilder. Thanks [daniellampl](https://github.com/daniellampl).
3+
14
## [1.8.3]
25
* 🛠️ [#828](https://github.com/fluttercommunity/chewie/pull/828): Fix the logic of the Center Play Button icon selection. Thanks [EmreDET](https://github.com/EmreDET).
36

lib/src/chewie_player.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ class ChewieController extends ChangeNotifier {
303303
this.subtitleBuilder,
304304
this.customControls,
305305
this.errorBuilder,
306+
this.bufferingBuilder,
306307
this.allowedScreenSleep = true,
307308
this.isLive = false,
308309
this.allowFullScreen = true,
@@ -350,6 +351,7 @@ class ChewieController extends ChangeNotifier {
350351
Subtitles? subtitle,
351352
Widget Function(BuildContext, dynamic)? subtitleBuilder,
352353
Widget? customControls,
354+
WidgetBuilder? bufferingBuilder,
353355
Widget Function(BuildContext, String)? errorBuilder,
354356
bool? allowedScreenSleep,
355357
bool? isLive,
@@ -400,6 +402,7 @@ class ChewieController extends ChangeNotifier {
400402
subtitleBuilder: subtitleBuilder ?? this.subtitleBuilder,
401403
customControls: customControls ?? this.customControls,
402404
errorBuilder: errorBuilder ?? this.errorBuilder,
405+
bufferingBuilder: bufferingBuilder ?? this.bufferingBuilder,
403406
allowedScreenSleep: allowedScreenSleep ?? this.allowedScreenSleep,
404407
isLive: isLive ?? this.isLive,
405408
allowFullScreen: allowFullScreen ?? this.allowFullScreen,
@@ -500,6 +503,9 @@ class ChewieController extends ChangeNotifier {
500503
final Widget Function(BuildContext context, String errorMessage)?
501504
errorBuilder;
502505

506+
/// When the video is buffering, you can build a custom widget.
507+
final WidgetBuilder? bufferingBuilder;
508+
503509
/// The Aspect Ratio of the Video. Important to get the correct size of the
504510
/// video!
505511
///

lib/src/cupertino/cupertino_controls.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,10 @@ class _CupertinoControlsState extends State<CupertinoControls>
9494
child: Stack(
9595
children: [
9696
if (_displayBufferingIndicator)
97-
const Center(
98-
child: CircularProgressIndicator(),
99-
)
97+
_chewieController?.bufferingBuilder?.call(context) ??
98+
const Center(
99+
child: CircularProgressIndicator(),
100+
)
100101
else
101102
_buildHitArea(),
102103
Column(

lib/src/material/material_controls.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,10 @@ class _MaterialControlsState extends State<MaterialControls>
8585
child: Stack(
8686
children: [
8787
if (_displayBufferingIndicator)
88-
const Center(
89-
child: CircularProgressIndicator(),
90-
)
88+
_chewieController?.bufferingBuilder?.call(context) ??
89+
const Center(
90+
child: CircularProgressIndicator(),
91+
)
9192
else
9293
_buildHitArea(),
9394
_buildActionBar(),

lib/src/material/material_desktop_controls.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,10 @@ class _MaterialDesktopControlsState extends State<MaterialDesktopControls>
8686
child: Stack(
8787
children: [
8888
if (_displayBufferingIndicator)
89-
const Center(
90-
child: CircularProgressIndicator(),
91-
)
89+
_chewieController?.bufferingBuilder?.call(context) ??
90+
const Center(
91+
child: CircularProgressIndicator(),
92+
)
9293
else
9394
_buildHitArea(),
9495
Column(

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: chewie
22
description: A video player for Flutter with Cupertino and Material play controls
3-
version: 1.8.3
3+
version: 1.8.4
44
homepage: https://github.com/fluttercommunity/chewie
55

66
environment:

0 commit comments

Comments
 (0)