opt live header

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-12-14 17:02:01 +08:00
parent 62506d3eb5
commit ae06d5f7f2
2 changed files with 51 additions and 30 deletions

View File

@@ -141,16 +141,38 @@ class _LiveHeaderControlState extends State<LiveHeaderControl>
onTap: () => plPlayerController.setAlwaysOnTop(!isAlwaysOnTop), onTap: () => plPlayerController.setAlwaysOnTop(!isAlwaysOnTop),
); );
}), }),
ComBtn( if (isFullScreen || Utils.isDesktop)
height: 30, ComBtn(
tooltip: '发弹幕', height: 30,
icon: const Icon( tooltip: '发弹幕',
size: 18, icon: const Icon(
Icons.comment_outlined, size: 18,
color: Colors.white, Icons.comment_outlined,
color: Colors.white,
),
onTap: widget.onSendDanmaku,
),
if (Platform.isAndroid || (Utils.isDesktop && !isFullScreen))
ComBtn(
height: 30,
tooltip: '画中画',
onTap: () async {
if (Utils.isDesktop) {
plPlayerController.toggleDesktopPip();
return;
}
if (await Floating().isPipAvailable) {
plPlayerController
..showControls.value = false
..enterPip();
}
},
icon: const Icon(
size: 18,
Icons.picture_in_picture_outlined,
color: Colors.white,
),
), ),
onTap: widget.onSendDanmaku,
),
Obx( Obx(
() { () {
final onlyPlayAudio = plPlayerController.onlyPlayAudio.value; final onlyPlayAudio = plPlayerController.onlyPlayAudio.value;
@@ -175,27 +197,26 @@ class _LiveHeaderControlState extends State<LiveHeaderControl>
); );
}, },
), ),
if (Platform.isAndroid || (Utils.isDesktop && !isFullScreen)) Obx(() {
ComBtn( final continuePlayInBackground =
plPlayerController.continuePlayInBackground.value;
return ComBtn(
height: 30, height: 30,
tooltip: '画中画', tooltip: '${continuePlayInBackground ? '关闭' : ''}后台播放',
onTap: () async { onTap: plPlayerController.setContinuePlayInBackground,
if (Utils.isDesktop) { icon: continuePlayInBackground
plPlayerController.toggleDesktopPip(); ? const Icon(
return; size: 18,
} Icons.play_circle,
if (await Floating().isPipAvailable) { color: Colors.white,
plPlayerController )
..showControls.value = false : const Icon(
..enterPip(); size: 18,
} Icons.play_circle_outline,
}, color: Colors.white,
icon: const Icon( ),
size: 18, );
Icons.picture_in_picture_outlined, }),
color: Colors.white,
),
),
ComBtn( ComBtn(
height: 30, height: 30,
tooltip: '定时关闭', tooltip: '定时关闭',

View File

@@ -2680,7 +2680,7 @@ class HeaderControlState extends State<HeaderControl>
: const SizedBox.shrink(), : const SizedBox.shrink(),
), ),
], ],
if (isFSOrPip || Utils.isDesktop) ...[ if (isFullScreen || Utils.isDesktop) ...[
SizedBox( SizedBox(
width: 42, width: 42,
height: 34, height: 34,