desktop pip

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-09-20 15:06:44 +08:00
parent 0745d83e4b
commit 36de899a35
8 changed files with 97 additions and 28 deletions

View File

@@ -6,6 +6,7 @@ import 'package:PiliPlus/pages/video/introduction/ugc/controller.dart';
import 'package:PiliPlus/plugin/pl_player/controller.dart';
import 'package:PiliPlus/utils/storage.dart';
import 'package:PiliPlus/utils/storage_key.dart';
import 'package:PiliPlus/utils/utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart'
show KeyDownEvent, KeyUpEvent, LogicalKeyboardKey;
@@ -71,7 +72,9 @@ class PlayerFocus extends StatelessWidget {
return true;
case LogicalKeyboardKey.escape:
if (isFullScreen) {
if (plPlayerController.isDesktopPip) {
plPlayerController.exitDesktopPip();
} else if (isFullScreen) {
plPlayerController.triggerFullScreen(status: false);
} else {
Get.back();
@@ -94,6 +97,10 @@ class PlayerFocus extends StatelessWidget {
}
return true;
case LogicalKeyboardKey.keyP when (Utils.isDesktop && hasPlayer):
plPlayerController.toggleDesktopPip();
return true;
case LogicalKeyboardKey.arrowUp:
if (hasPlayer) {
final volume = math.min(1.0, plPlayerController.volume.value + 0.1);