Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-09-30 11:35:42 +08:00
parent 06b258cff1
commit 299ee09749
7 changed files with 69 additions and 53 deletions

View File

@@ -304,8 +304,12 @@ class PlPlayerController {
}
void enterPip() {
if (Get.currentRoute.startsWith('/video')) {
PageUtils.enterPip(width: width, height: height);
if (videoController != null) {
final state = videoController!.player.state;
PageUtils.enterPip(
width: state.width ?? width,
height: state.height ?? height,
);
}
}
@@ -547,7 +551,8 @@ class PlPlayerController {
if (Platform.isAndroid && autoPiP) {
Utils.channel.setMethodCallHandler((call) async {
if (call.method == 'onUserLeaveHint') {
if (playerStatus.status.value == PlayerStatus.playing) {
if (playerStatus.status.value == PlayerStatus.playing &&
Get.currentRoute.startsWith('/video')) {
enterPip();
}
}