Skip to content

Commit 23532e1

Browse files
committed
Add option to hide full screen button
1 parent 58931ed commit 23532e1

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 0.9.1
4+
5+
* Add option to hide full screen button
6+
37
## 0.9.0
48

59
* **Breaking changes**: Add a `ChewieController` to make customizations and control from outside of the player easier.

lib/src/chewie_player.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ class ChewieController extends ChangeNotifier {
161161
this.customControls,
162162
this.allowedScreenSleep = true,
163163
this.isLive = false,
164+
this.allowFullScreen = true,
164165
}) : assert(videoPlayerController != null,
165166
'You must provide a controller to play a video') {
166167
_initialize();
@@ -215,6 +216,9 @@ class ChewieController extends ChangeNotifier {
215216
/// Defines if the controls should be for live stream video
216217
final bool isLive;
217218

219+
/// Defines if the fullscreen control should be shown
220+
final bool allowFullScreen;
221+
218222
static ChewieController of(BuildContext context) {
219223
final _ChewieControllerProvider chewieControllerProvider =
220224
context.inheritFromWidgetOfExactType(_ChewieControllerProvider);

lib/src/cupertino_controls.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,10 @@ class _CupertinoControlsState extends State<CupertinoControls> {
376376
),
377377
child: Row(
378378
children: <Widget>[
379-
_buildExpandButton(
380-
backgroundColor, iconColor, barHeight, buttonPadding),
379+
chewieController.allowFullScreen
380+
? _buildExpandButton(
381+
backgroundColor, iconColor, barHeight, buttonPadding)
382+
: Container(),
381383
Expanded(child: Container()),
382384
_buildMuteButton(
383385
controller, backgroundColor, iconColor, barHeight, buttonPadding),

lib/src/material_controls.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ class _MaterialControlsState extends State<MaterialControls> {
9696
: _buildPosition(iconColor),
9797
chewieController.isLive ? const SizedBox() : _buildProgressBar(),
9898
_buildMuteButton(controller),
99-
_buildExpandButton(),
99+
chewieController.allowFullScreen
100+
? _buildExpandButton()
101+
: Container(),
100102
],
101103
),
102104
),

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: 0.9.0
3+
version: 0.9.1
44
homepage: https://github.com/brianegan/chewie
55
authors:
66
- Brian Egan <[email protected]>

0 commit comments

Comments
 (0)