diff --git a/lib/pages/live_room/view.dart b/lib/pages/live_room/view.dart index 8e6b750b..ca5b35e0 100644 --- a/lib/pages/live_room/view.dart +++ b/lib/pages/live_room/view.dart @@ -132,7 +132,7 @@ class _LiveRoomPageState extends State final GlobalKey playerKey = GlobalKey(); double? padding; - Widget videoPlayerPanel([Color? fill]) { + Widget videoPlayerPanel({Color? fill, Alignment? alignment}) { return PopScope( canPop: !isFullScreen, onPopInvokedWithResult: (bool didPop, Object? result) { @@ -152,6 +152,7 @@ class _LiveRoomPageState extends State return PLVideoPlayer( key: playerKey, fill: fill, + alignment: alignment, plPlayerController: plPlayerController, bottomControl: BottomControl( plPlayerController: plPlayerController, @@ -273,7 +274,9 @@ class _LiveRoomPageState extends State ? 0 : MediaQuery.paddingOf(context).top) : Get.height - 56 - 85 - padding!, - child: videoPlayerPanel(), + child: videoPlayerPanel( + alignment: isFullScreen ? null : Alignment.topCenter, + ), ), ), ], @@ -433,7 +436,7 @@ class _LiveRoomPageState extends State child: MediaQuery.removePadding( removeRight: true, context: context, - child: videoPlayerPanel(Colors.transparent), + child: videoPlayerPanel(fill: Colors.transparent), ), ), ), diff --git a/lib/plugin/pl_player/view.dart b/lib/plugin/pl_player/view.dart index 19df4812..2f867c7d 100644 --- a/lib/plugin/pl_player/view.dart +++ b/lib/plugin/pl_player/view.dart @@ -53,6 +53,7 @@ class PLVideoPlayer extends StatefulWidget { this.showEpisodes, this.showViewPoints, this.fill, + this.alignment, super.key, }); @@ -69,6 +70,7 @@ class PLVideoPlayer extends StatefulWidget { final Function? showEpisodes; final VoidCallback? showViewPoints; final Color? fill; + final Alignment? alignment; @override State createState() => _PLVideoPlayerState(); @@ -898,6 +900,7 @@ class _PLVideoPlayerState extends State child: Video( fill: widget.fill ?? Colors.black, key: key, + alignment: widget.alignment ?? Alignment.center, controller: videoController, controls: NoVideoControls, pauseUponEnteringBackgroundMode: