From bb1c3108ea2f85deaa623594f7421a03d83a851e Mon Sep 17 00:00:00 2001 From: vitas <1763692101@qq.com> Date: Fri, 25 Oct 2019 16:26:18 +0800 Subject: [PATCH 1/2] video alignment --- lib/src/player_with_controls.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/src/player_with_controls.dart b/lib/src/player_with_controls.dart index 4dfd32023..bd32ae4cc 100644 --- a/lib/src/player_with_controls.dart +++ b/lib/src/player_with_controls.dart @@ -32,7 +32,8 @@ class PlayerWithControls extends StatelessWidget { child: Stack( children: [ chewieController.placeholder ?? Container(), - Center( + Container( + alignment: chewieController.alignment ?? Alignment.center, child: AspectRatio( aspectRatio: chewieController.aspectRatio ?? _calculateAspectRatio(context), From 1842d0138e923796b3d4428937321ef7454d4c1b Mon Sep 17 00:00:00 2001 From: vitas <1763692101@qq.com> Date: Fri, 25 Oct 2019 16:30:28 +0800 Subject: [PATCH 2/2] add alignment --- lib/src/chewie_player.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/src/chewie_player.dart b/lib/src/chewie_player.dart index 7492b2d5d..b89156c09 100644 --- a/lib/src/chewie_player.dart +++ b/lib/src/chewie_player.dart @@ -169,6 +169,7 @@ class ChewieController extends ChangeNotifier { ChewieController({ this.videoPlayerController, this.aspectRatio, + this.alignment, this.autoInitialize = false, this.autoPlay = false, this.startAt, @@ -233,6 +234,10 @@ class ChewieController extends ChangeNotifier { /// /// Will fallback to fitting within the space allowed. final double aspectRatio; + + /// video alignment + /// default Alignment.center + final Alignment alignment; /// The colors to use for controls on iOS. By default, the iOS player uses /// colors sampled from the original iOS 11 designs.