mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
@@ -309,10 +309,11 @@ class PlPlayerController {
|
||||
}
|
||||
}
|
||||
|
||||
void enterPip() {
|
||||
void enterPip({bool isAuto = false}) {
|
||||
if (videoController != null) {
|
||||
final state = videoController!.player.state;
|
||||
PageUtils.enterPip(
|
||||
isAuto: isAuto,
|
||||
width: state.width ?? width,
|
||||
height: state.height ?? height,
|
||||
);
|
||||
@@ -556,12 +557,16 @@ class PlPlayerController {
|
||||
}
|
||||
|
||||
if (Platform.isAndroid && autoPiP) {
|
||||
Utils.channel.setMethodCallHandler((call) async {
|
||||
if (call.method == 'onUserLeaveHint') {
|
||||
if (playerStatus.status.value == PlayerStatus.playing &&
|
||||
Get.currentRoute.startsWith('/video')) {
|
||||
enterPip();
|
||||
}
|
||||
Utils.sdkInt.then((sdkInt) {
|
||||
if (sdkInt < 12) {
|
||||
Utils.channel.setMethodCallHandler((call) async {
|
||||
if (call.method == 'onUserLeaveHint') {
|
||||
if (playerStatus.playing &&
|
||||
Get.currentRoute.startsWith('/video')) {
|
||||
enterPip();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user