Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-02-01 17:06:21 +08:00
parent 8f08104f37
commit 37fa165f59
9 changed files with 21 additions and 39 deletions

View File

@@ -284,7 +284,11 @@ class PlPlayerController {
late bool _shouldSetPip = false;
bool get _isCurrVideoPage {
final currentRoute = Get.currentRoute;
final routing = Get.routing;
if (routing.route is! GetPageRoute) {
return false;
}
final currentRoute = routing.current;
return currentRoute.startsWith('/video') ||
currentRoute.startsWith('/liveRoom');
}
@@ -297,6 +301,7 @@ class PlPlayerController {
void enterPip({bool isAuto = false}) {
if (videoController != null) {
controls = false;
final state = videoController!.player.state;
PageUtils.enterPip(
isAuto: isAuto,
@@ -546,7 +551,7 @@ class PlPlayerController {
if (Platform.isAndroid && autoPiP) {
Utils.sdkInt.then((sdkInt) {
if (sdkInt < 31) {
if (sdkInt < 36) {
Utils.channel.setMethodCallHandler((call) async {
if (call.method == 'onUserLeaveHint') {
if (playerStatus.playing && _isCurrVideoPage) {