Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-30 13:58:14 +08:00
parent 9a63e23478
commit 5f2e863cc2
8 changed files with 95 additions and 129 deletions

View File

@@ -47,13 +47,11 @@ class HeaderControl extends StatefulWidget implements PreferredSizeWidget {
const HeaderControl({
required this.controller,
required this.videoDetailCtr,
this.floating,
required this.heroTag,
super.key,
});
final PlPlayerController controller;
final VideoDetailController videoDetailCtr;
final Floating? floating;
final String heroTag;
@override
@@ -2118,8 +2116,7 @@ class HeaderControlState extends State<HeaderControl> {
padding: WidgetStateProperty.all(EdgeInsets.zero),
),
onPressed: () async {
bool canUsePiP = widget.floating != null &&
await widget.floating!.isPipAvailable;
bool canUsePiP = await Floating().isPipAvailable;
widget.controller.hiddenControls(false);
if (canUsePiP) {
bool enableBackgroundPlay = setting.get(
@@ -2189,10 +2186,9 @@ class HeaderControlState extends State<HeaderControl> {
}
if (!context.mounted) return;
PageUtils.enterPip(
widget.floating!,
widget
width: widget
.videoDetailCtr.data.dash!.video!.first.width!,
widget
height: widget
.videoDetailCtr.data.dash!.video!.first.height!,
);
}