Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-04-28 15:16:34 +08:00
parent 58e4ecc421
commit 2b7f8af060

View File

@@ -273,20 +273,20 @@ class PlPlayerController with BlockConfigMixin {
late bool _shouldSetPip = false; late bool _shouldSetPip = false;
bool get _isCurrVideoPage { static bool get _isCurrVideoPage {
final routing = Get.routing; final routing = Get.routing;
if (routing.route is! GetPageRoute) { if (routing.route is! GetPageRoute) {
return false; return false;
} }
final currentRoute = routing.current; return _isVideoPage(routing.current);
return currentRoute.startsWith('/video') ||
currentRoute.startsWith('/liveRoom');
} }
bool get _isPreviousVideoPage { static bool get _isPreviousVideoPage {
final previousRoute = Get.previousRoute; return _isVideoPage(Get.previousRoute);
return previousRoute.startsWith('/video') || }
previousRoute.startsWith('/liveRoom');
static bool _isVideoPage(String routeName) {
return routeName == '/videoV' || routeName == '/liveRoom';
} }
void enterPip({bool isAuto = false}) { void enterPip({bool isAuto = false}) {
@@ -1636,7 +1636,8 @@ class PlPlayerController with BlockConfigMixin {
if (!_isCloseAll && _playerCount > 1) { if (!_isCloseAll && _playerCount > 1) {
_playerCount -= 1; _playerCount -= 1;
_heartDuration = 0; _heartDuration = 0;
if (!_isPreviousVideoPage) { // called after pop
if (!_isCurrVideoPage) {
pause(); pause();
} }
return; return;