Skip to content

Commit

Permalink
Merge commit '75085dccc419afa0329fc20e007c9299b38663ed' into github/c…
Browse files Browse the repository at this point in the history
…ustom-lg

* commit '75085dccc419afa0329fc20e007c9299b38663ed':
  chewie, version 1.8.4. Addresses Issue fluttercommunity#838.
  Add bufferingBuilder
  • Loading branch information
lg8294 committed Sep 13, 2024
2 parents ba00f80 + 75085dc commit 981cd13
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [1.8.4]
* 🛠️ [#838](https://github.com/fluttercommunity/chewie/pull/838): Add bufferingBuilder. Thanks [daniellampl](https://github.com/daniellampl).

## [1.8.3]
* 🛠️ [#828](https://github.com/fluttercommunity/chewie/pull/828): Fix the logic of the Center Play Button icon selection. Thanks [EmreDET](https://github.com/EmreDET).

Expand Down
6 changes: 6 additions & 0 deletions lib/src/chewie_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ class ChewieController extends ChangeNotifier {
this.subtitleBuilder,
this.customControls,
this.errorBuilder,
this.bufferingBuilder,
this.allowedScreenSleep = true,
this.isLive = false,
this.allowFullScreen = true,
Expand Down Expand Up @@ -350,6 +351,7 @@ class ChewieController extends ChangeNotifier {
Subtitles? subtitle,
Widget Function(BuildContext, dynamic)? subtitleBuilder,
Widget? customControls,
WidgetBuilder? bufferingBuilder,
Widget Function(BuildContext, String)? errorBuilder,
bool? allowedScreenSleep,
bool? isLive,
Expand Down Expand Up @@ -400,6 +402,7 @@ class ChewieController extends ChangeNotifier {
subtitleBuilder: subtitleBuilder ?? this.subtitleBuilder,
customControls: customControls ?? this.customControls,
errorBuilder: errorBuilder ?? this.errorBuilder,
bufferingBuilder: bufferingBuilder ?? this.bufferingBuilder,
allowedScreenSleep: allowedScreenSleep ?? this.allowedScreenSleep,
isLive: isLive ?? this.isLive,
allowFullScreen: allowFullScreen ?? this.allowFullScreen,
Expand Down Expand Up @@ -500,6 +503,9 @@ class ChewieController extends ChangeNotifier {
final Widget Function(BuildContext context, String errorMessage)?
errorBuilder;

/// When the video is buffering, you can build a custom widget.
final WidgetBuilder? bufferingBuilder;

/// The Aspect Ratio of the Video. Important to get the correct size of the
/// video!
///
Expand Down
7 changes: 4 additions & 3 deletions lib/src/cupertino/cupertino_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ class _CupertinoControlsState extends State<CupertinoControls>
child: Stack(
children: [
if (_displayBufferingIndicator)
const Center(
child: CircularProgressIndicator(),
)
_chewieController?.bufferingBuilder?.call(context) ??
const Center(
child: CircularProgressIndicator(),
)
else
_buildHitArea(),
Column(
Expand Down
7 changes: 4 additions & 3 deletions lib/src/material/material_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ class _MaterialControlsState extends State<MaterialControls>
child: Stack(
children: [
if (_displayBufferingIndicator)
const Center(
child: CircularProgressIndicator(),
)
_chewieController?.bufferingBuilder?.call(context) ??
const Center(
child: CircularProgressIndicator(),
)
else
_buildHitArea(),
_buildActionBar(),
Expand Down
7 changes: 4 additions & 3 deletions lib/src/material/material_desktop_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ class _MaterialDesktopControlsState extends State<MaterialDesktopControls>
child: Stack(
children: [
if (_displayBufferingIndicator)
const Center(
child: CircularProgressIndicator(),
)
_chewieController?.bufferingBuilder?.call(context) ??
const Center(
child: CircularProgressIndicator(),
)
else
_buildHitArea(),
Column(
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: chewie
description: A video player for Flutter with Cupertino and Material play controls
version: 1.8.3
version: 1.8.4
homepage: https://github.com/fluttercommunity/chewie

environment:
Expand Down

0 comments on commit 981cd13

Please sign in to comment.