mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-26 05:16:01 +08:00
@@ -2158,9 +2158,8 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
plPlayerController.toggleDesktopPip();
|
||||
return;
|
||||
}
|
||||
bool canUsePiP = await Floating().isPipAvailable;
|
||||
plPlayerController.hiddenControls(false);
|
||||
if (canUsePiP) {
|
||||
if (await Floating().isPipAvailable) {
|
||||
plPlayerController.hiddenControls(false);
|
||||
if (context.mounted &&
|
||||
!videoPlayerServiceHandler!.enableBackgroundPlay) {
|
||||
final theme = Theme.of(context);
|
||||
@@ -2236,10 +2235,7 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
await Future.delayed(const Duration(seconds: 3));
|
||||
}
|
||||
if (!context.mounted) return;
|
||||
PageUtils.enterPip(
|
||||
width: widget.videoDetailCtr.firstVideo.width,
|
||||
height: widget.videoDetailCtr.firstVideo.height,
|
||||
);
|
||||
plPlayerController.enterPip();
|
||||
}
|
||||
},
|
||||
icon: const Icon(
|
||||
|
||||
@@ -29,12 +29,12 @@ class PlayerFocus extends StatelessWidget {
|
||||
final VoidCallback onSendDanmaku;
|
||||
final bool Function()? canPlay;
|
||||
|
||||
static bool _shouldHandled(KeyEvent event) {
|
||||
return event.logicalKey == LogicalKeyboardKey.tab ||
|
||||
event.logicalKey == LogicalKeyboardKey.arrowLeft ||
|
||||
event.logicalKey == LogicalKeyboardKey.arrowRight ||
|
||||
event.logicalKey == LogicalKeyboardKey.arrowUp ||
|
||||
event.logicalKey == LogicalKeyboardKey.arrowDown;
|
||||
static bool _shouldHandle(LogicalKeyboardKey logicalKey) {
|
||||
return logicalKey == LogicalKeyboardKey.tab ||
|
||||
logicalKey == LogicalKeyboardKey.arrowLeft ||
|
||||
logicalKey == LogicalKeyboardKey.arrowRight ||
|
||||
logicalKey == LogicalKeyboardKey.arrowUp ||
|
||||
logicalKey == LogicalKeyboardKey.arrowDown;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -43,7 +43,7 @@ class PlayerFocus extends StatelessWidget {
|
||||
autofocus: true,
|
||||
onKeyEvent: (node, event) {
|
||||
final handled = _handleKey(event);
|
||||
if (handled || _shouldHandled(event)) {
|
||||
if (handled || _shouldHandle(event.logicalKey)) {
|
||||
return KeyEventResult.handled;
|
||||
}
|
||||
return KeyEventResult.ignored;
|
||||
|
||||
Reference in New Issue
Block a user