diff --git a/lib/src/configuration/better_player_configuration.dart b/lib/src/configuration/better_player_configuration.dart index a493f9a78..9da409272 100644 --- a/lib/src/configuration/better_player_configuration.dart +++ b/lib/src/configuration/better_player_configuration.dart @@ -100,6 +100,10 @@ class BetterPlayerConfiguration { /// ignored. final bool autoDetectFullscreenDeviceOrientation; + ///Defines if player should auto detect full screen aspect ration of the video. + ///If [deviceOrientationsOnFullScreen] is true this is done automaticaly also. + final bool autoDetectFullscreenAspectRatio; + ///Defines flag which enables/disables lifecycle handling (pause on app closed, ///play on app resumed). Default value is true. final bool handleLifecycle; @@ -153,6 +157,7 @@ class BetterPlayerConfiguration { this.playerVisibilityChangedBehavior, this.translations, this.autoDetectFullscreenDeviceOrientation = false, + this.autoDetectFullscreenAspectRatio = false, this.handleLifecycle = true, this.autoDispose = true, this.expandToFill = true, diff --git a/lib/src/core/better_player_with_controls.dart b/lib/src/core/better_player_with_controls.dart index 506cbb76f..2891daedc 100644 --- a/lib/src/core/better_player_with_controls.dart +++ b/lib/src/core/better_player_with_controls.dart @@ -82,8 +82,10 @@ class _BetterPlayerWithControlsState extends State { double? aspectRatio; if (betterPlayerController.isFullScreen) { - if (betterPlayerController - .betterPlayerConfiguration.autoDetectFullscreenDeviceOrientation) { + if (betterPlayerController.betterPlayerConfiguration + .autoDetectFullscreenDeviceOrientation || + betterPlayerController + .betterPlayerConfiguration.autoDetectFullscreenAspectRatio) { aspectRatio = betterPlayerController.videoPlayerController?.value.aspectRatio ?? 1.0;