diff --git a/lib/pages/player/player_item.dart b/lib/pages/player/player_item.dart index 0c9d301c..6bf489ed 100644 --- a/lib/pages/player/player_item.dart +++ b/lib/pages/player/player_item.dart @@ -130,7 +130,7 @@ class _PlayerItemState extends State } void _handleDoubleTap() { - if (Utils.isDesktop()) { + if (Utils.isDesktop() && !videoPageController.isPip) { handleFullscreen(); } else { playerController.playOrPause(); @@ -685,7 +685,9 @@ class _PlayerItemState extends State // F键被按下 if (event.logicalKey == LogicalKeyboardKey.keyF) { - handleFullscreen(); + if (!videoPageController.isPip) { + handleFullscreen(); + } } // D键盘被按下 if (event.logicalKey == diff --git a/lib/pages/player/smallest_player_item_panel.dart b/lib/pages/player/smallest_player_item_panel.dart index b9745bae..b220b2aa 100644 --- a/lib/pages/player/smallest_player_item_panel.dart +++ b/lib/pages/player/smallest_player_item_panel.dart @@ -651,16 +651,17 @@ class _SmallestPlayerItemPanelState extends State { ], ), ), - if (!videoPageController.isPip) - IconButton( - color: Colors.white, - icon: Icon(videoPageController.isFullscreen - ? Icons.fullscreen_exit_rounded - : Icons.fullscreen_rounded), - onPressed: () { - widget.handleFullscreen(); - }, - ), + (!videoPageController.isPip) + ? IconButton( + color: Colors.white, + icon: Icon(videoPageController.isFullscreen + ? Icons.fullscreen_exit_rounded + : Icons.fullscreen_rounded), + onPressed: () { + widget.handleFullscreen(); + }, + ) + : const Text(' '), ], ), ), diff --git a/lib/pages/video/video_controller.dart b/lib/pages/video/video_controller.dart index 5632d655..53d81039 100644 --- a/lib/pages/video/video_controller.dart +++ b/lib/pages/video/video_controller.dart @@ -23,19 +23,19 @@ abstract class _VideoPageController with Store { @observable int currentRoad = 0; - // 全屏状态 + /// 全屏状态 @observable bool isFullscreen = false; - // PIP状态 + /// 画中画状态 @observable bool isPip = false; - // 播放列表显示状态 + /// 播放列表显示状态 @observable bool showTabBody = true; - // 上次观看位置 + /// 上次观看位置 @observable int historyOffset = 0; diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index ee968601..6dd2ff1a 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -476,7 +476,6 @@ class Utils { // 进入桌面设备小窗模式 static Future enterDesktopPIPWindow() async { await windowManager.setAlwaysOnTop(true); - await windowManager.setResizable(false); await windowManager.setSize(const Size(480, 270)); } @@ -484,7 +483,6 @@ class Utils { static Future exitDesktopPIPWindow() async { bool isLowResolution = await Utils.isLowResolution(); await windowManager.setAlwaysOnTop(false); - await windowManager.setResizable(true); await windowManager.setSize(isLowResolution ? const Size(800, 600) : const Size(1280, 860)); await windowManager.center(); }