Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/src/chewie_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ class ChewieController extends ChangeNotifier {
this.hideControlsTimer = defaultHideControlsTimer,
this.controlsSafeAreaMinimum = EdgeInsets.zero,
this.pauseOnBackgroundTap = false,
this.allowDoubleTapToggleFullScreen = true,
}) : assert(
playbackSpeeds.every((speed) => speed > 0),
'The playbackSpeeds values must all be greater than 0',
Expand Down Expand Up @@ -394,6 +395,7 @@ class ChewieController extends ChangeNotifier {
)?
routePageBuilder,
bool? pauseOnBackgroundTap,
bool? allowDoubleTapToggleFullScreen,
}) {
return ChewieController(
draggableProgressBar: draggableProgressBar ?? this.draggableProgressBar,
Expand Down Expand Up @@ -458,6 +460,8 @@ class ChewieController extends ChangeNotifier {
progressIndicatorDelay:
progressIndicatorDelay ?? this.progressIndicatorDelay,
pauseOnBackgroundTap: pauseOnBackgroundTap ?? this.pauseOnBackgroundTap,
allowDoubleTapToggleFullScreen:
allowDoubleTapToggleFullScreen ?? this.allowDoubleTapToggleFullScreen,
);
}

Expand Down Expand Up @@ -630,6 +634,9 @@ class ChewieController extends ChangeNotifier {
/// Defines if the player should pause when the background is tapped
final bool pauseOnBackgroundTap;

/// Defines if double tap should toggle fullscreen mode
final bool allowDoubleTapToggleFullScreen;

static ChewieController of(BuildContext context) {
final chewieControllerProvider = context
.dependOnInheritedWidgetOfExactType<ChewieControllerProvider>()!;
Expand Down
3 changes: 3 additions & 0 deletions lib/src/material/material_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,9 @@ class _MaterialControlsState extends State<MaterialControls>
});
}
},
onDoubleTap: chewieController.allowDoubleTapToggleFullScreen
? _onExpandCollapse
: null,
child: Container(
alignment: Alignment.center,
color: Colors
Expand Down