From 061d6e609171a7f90932dfaade5183a5628a21d7 Mon Sep 17 00:00:00 2001 From: orz12 Date: Tue, 2 Jan 2024 07:51:42 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9A=B4=E5=8A=9B=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=B8=8D=E8=87=AA=E5=8A=A8=E6=92=AD=E6=94=BE=E6=97=B6Obx?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 用plPlayerController?.isFullScreen.value的话Obx就会识别不到有变量,所以加个额外的变量上去,过掉它的智障检测 --- lib/pages/video/detail/view.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/pages/video/detail/view.dart b/lib/pages/video/detail/view.dart index 29566e7b..f70da494 100644 --- a/lib/pages/video/detail/view.dart +++ b/lib/pages/video/detail/view.dart @@ -302,7 +302,10 @@ class _VideoDetailPageState extends State return [ Obx(() => SliverAppBar( automaticallyImplyLeading: false, - pinned: false, + // 假装使用一个非空变量,避免Obx检测不到而罢工 + pinned: videoDetailController + .autoPlay.value ^ false ^ videoDetailController + .autoPlay.value, elevation: 0, scrolledUnderElevation: 0, forceElevated: innerBoxIsScrolled, From 9ae0e9284b8d0bdc0ff84a52e31b56da64aabc07 Mon Sep 17 00:00:00 2001 From: orz12 Date: Tue, 2 Jan 2024 08:19:39 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E4=BB=85=E5=85=A8?= =?UTF-8?q?=E5=B1=8F=E6=97=B6=E9=9A=90=E8=97=8F=E4=B8=8B=E6=96=B9=E8=BF=9B?= =?UTF-8?q?=E5=BA=A6=E6=9D=A1=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/plugin/pl_player/models/bottom_progress_behavior.dart | 5 +++-- lib/plugin/pl_player/view.dart | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/plugin/pl_player/models/bottom_progress_behavior.dart b/lib/plugin/pl_player/models/bottom_progress_behavior.dart index c632669c..c7f1453d 100644 --- a/lib/plugin/pl_player/models/bottom_progress_behavior.dart +++ b/lib/plugin/pl_player/models/bottom_progress_behavior.dart @@ -3,14 +3,15 @@ enum BtmProgresBehavior { alwaysShow, alwaysHide, onlyShowFullScreen, + onlyHideFullScreen, } extension BtmProgresBehaviorDesc on BtmProgresBehavior { - String get description => ['始终展示', '始终隐藏', '仅全屏时展示'][index]; + String get description => ['始终展示', '始终隐藏', '仅全屏时展示', '仅全屏时隐藏'][index]; } extension BtmProgresBehaviorCode on BtmProgresBehavior { - static final List _codeList = [0, 1, 2]; + static final List _codeList = [0, 1, 2, 3]; int get code => _codeList[index]; static BtmProgresBehavior? fromCode(int code) { diff --git a/lib/plugin/pl_player/view.dart b/lib/plugin/pl_player/view.dart index 89b85607..781fa614 100644 --- a/lib/plugin/pl_player/view.dart +++ b/lib/plugin/pl_player/view.dart @@ -610,6 +610,10 @@ class _PLVideoPlayerState extends State BtmProgresBehavior.onlyShowFullScreen.code && !_.isFullScreen.value) { return Container(); + } else if (defaultBtmProgressBehavior == + BtmProgresBehavior.onlyHideFullScreen.code && + _.isFullScreen.value) { + return Container(); } if (_.videoType.value == 'live') {