Skip to content

Commit

Permalink
Add option to hide full screen button
Browse files Browse the repository at this point in the history
  • Loading branch information
cbenhagen committed Jan 28, 2019
1 parent 58931ed commit 23532e1
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.9.1

* Add option to hide full screen button

## 0.9.0

* **Breaking changes**: Add a `ChewieController` to make customizations and control from outside of the player easier.
Expand Down
4 changes: 4 additions & 0 deletions lib/src/chewie_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ class ChewieController extends ChangeNotifier {
this.customControls,
this.allowedScreenSleep = true,
this.isLive = false,
this.allowFullScreen = true,
}) : assert(videoPlayerController != null,
'You must provide a controller to play a video') {
_initialize();
Expand Down Expand Up @@ -215,6 +216,9 @@ class ChewieController extends ChangeNotifier {
/// Defines if the controls should be for live stream video
final bool isLive;

/// Defines if the fullscreen control should be shown
final bool allowFullScreen;

static ChewieController of(BuildContext context) {
final _ChewieControllerProvider chewieControllerProvider =
context.inheritFromWidgetOfExactType(_ChewieControllerProvider);
Expand Down
6 changes: 4 additions & 2 deletions lib/src/cupertino_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,10 @@ class _CupertinoControlsState extends State<CupertinoControls> {
),
child: Row(
children: <Widget>[
_buildExpandButton(
backgroundColor, iconColor, barHeight, buttonPadding),
chewieController.allowFullScreen
? _buildExpandButton(
backgroundColor, iconColor, barHeight, buttonPadding)
: Container(),
Expanded(child: Container()),
_buildMuteButton(
controller, backgroundColor, iconColor, barHeight, buttonPadding),
Expand Down
4 changes: 3 additions & 1 deletion lib/src/material_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ class _MaterialControlsState extends State<MaterialControls> {
: _buildPosition(iconColor),
chewieController.isLive ? const SizedBox() : _buildProgressBar(),
_buildMuteButton(controller),
_buildExpandButton(),
chewieController.allowFullScreen
? _buildExpandButton()
: Container(),
],
),
),
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: 0.9.0
version: 0.9.1
homepage: https://github.com/brianegan/chewie
authors:
- Brian Egan <[email protected]>
Expand Down

0 comments on commit 23532e1

Please sign in to comment.