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,6 +141,7 @@ class _LiveHeaderControlState extends State<LiveHeaderControl>
onTap: () => plPlayerController.setAlwaysOnTop(!isAlwaysOnTop), onTap: () => plPlayerController.setAlwaysOnTop(!isAlwaysOnTop),
); );
}), }),
if (isFullScreen || Utils.isDesktop)
ComBtn( ComBtn(
height: 30, height: 30,
tooltip: '发弹幕', tooltip: '发弹幕',
@@ -151,6 +152,27 @@ class _LiveHeaderControlState extends State<LiveHeaderControl>
), ),
onTap: widget.onSendDanmaku, 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,
),
),
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;
}
if (await Floating().isPipAvailable) {
plPlayerController
..showControls.value = false
..enterPip();
}
},
icon: const Icon(
size: 18, size: 18,
Icons.picture_in_picture_outlined, Icons.play_circle,
color: Colors.white,
)
: const Icon(
size: 18,
Icons.play_circle_outline,
color: Colors.white, 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,