mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
@@ -275,17 +275,6 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Platform.isAndroid &&
|
||||
plPlayerController!.autoPiP &&
|
||||
await Utils.sdkInt >= 12) {
|
||||
if (isPlaying) {
|
||||
plPlayerController!.enterPip(isAuto: true);
|
||||
} else {
|
||||
Utils.channel.invokeMethod('setPipAutoEnterEnabled', {
|
||||
'autoEnable': false,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 继续播放或重新播放
|
||||
|
||||
@@ -309,6 +309,8 @@ class PlPlayerController {
|
||||
}
|
||||
}
|
||||
|
||||
late bool shouldSetPip = false;
|
||||
|
||||
void enterPip({bool isAuto = false}) {
|
||||
if (videoController != null) {
|
||||
final state = videoController!.player.state;
|
||||
@@ -320,6 +322,14 @@ class PlPlayerController {
|
||||
}
|
||||
}
|
||||
|
||||
void disableAutoEnterPip() {
|
||||
if (shouldSetPip) {
|
||||
Utils.channel.invokeMethod('setPipAutoEnterEnabled', {
|
||||
'autoEnable': false,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// 弹幕权重
|
||||
late final enableTapDm = Utils.isMobile && Pref.enableTapDm;
|
||||
late int danmakuWeight = Pref.danmakuWeight;
|
||||
@@ -567,6 +577,8 @@ class PlPlayerController {
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
shouldSetPip = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1008,8 +1020,12 @@ class PlPlayerController {
|
||||
subscriptions = {
|
||||
videoPlayerController!.stream.playing.listen((event) {
|
||||
if (event) {
|
||||
if (shouldSetPip) {
|
||||
enterPip(isAuto: true);
|
||||
}
|
||||
playerStatus.status.value = PlayerStatus.playing;
|
||||
} else {
|
||||
disableAutoEnterPip();
|
||||
playerStatus.status.value = PlayerStatus.paused;
|
||||
}
|
||||
videoPlayerServiceHandler?.onStatusChange(
|
||||
@@ -1699,10 +1715,12 @@ class PlPlayerController {
|
||||
final previousRoute = Get.previousRoute;
|
||||
if (!previousRoute.startsWith('/video') &&
|
||||
!previousRoute.startsWith('/liveRoom')) {
|
||||
disableAutoEnterPip();
|
||||
pause();
|
||||
}
|
||||
return;
|
||||
}
|
||||
disableAutoEnterPip();
|
||||
setPlayCallBack(null);
|
||||
dmState.clear();
|
||||
_playerCount = 0;
|
||||
|
||||
@@ -570,7 +570,7 @@ packages:
|
||||
description:
|
||||
path: "."
|
||||
ref: version-3
|
||||
resolved-ref: "929e9ec1312d9d1b4755d7589dd53db5b4d6d50d"
|
||||
resolved-ref: a66ec0b9dabde6b5880a3f4f3425e57842a38e51
|
||||
url: "https://github.com/bggRGjQaUbCoE/floating.git"
|
||||
source: git
|
||||
version: "3.0.0"
|
||||
|
||||
Reference in New Issue
Block a user