mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-04 00:59:50 +08:00
desktop pip
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1925,7 +1925,9 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
||||
color: Colors.white,
|
||||
),
|
||||
onPressed: () {
|
||||
if (isFullScreen) {
|
||||
if (plPlayerController.isDesktopPip) {
|
||||
plPlayerController.exitDesktopPip();
|
||||
} else if (isFullScreen) {
|
||||
plPlayerController.triggerFullScreen(status: false);
|
||||
} else if (!horizontalScreen && !isPortrait) {
|
||||
verticalScreenForTwoSeconds();
|
||||
@@ -2123,7 +2125,7 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
||||
},
|
||||
),
|
||||
),
|
||||
if (Platform.isAndroid)
|
||||
if (Platform.isAndroid || Utils.isDesktop)
|
||||
SizedBox(
|
||||
width: 42,
|
||||
height: 34,
|
||||
@@ -2133,6 +2135,10 @@ class HeaderControlState extends TripleState<HeaderControl> {
|
||||
padding: WidgetStatePropertyAll(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () async {
|
||||
if (Utils.isDesktop) {
|
||||
plPlayerController.toggleDesktopPip();
|
||||
return;
|
||||
}
|
||||
bool canUsePiP = await Floating().isPipAvailable;
|
||||
plPlayerController.hiddenControls(false);
|
||||
if (canUsePiP) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user