fix(flutter): 回前台复位残留画中画状态

This commit is contained in:
Zhou Weidong committed 2026-10-20 14:28:05 +08:00
1 parent 28ff9a7642
commit bc8f3bcab7
2 files changed
+36

No files matched your search

+8
View File
@@ -313,6 +313,14 @@ class PlayerLogic extends ChangeNotifier {
void onLifecycle(AppLifecycleState state) {
if (state != AppLifecycleState.resumed) unawaited(saveCurrentProgress());
if (state == AppLifecycleState.resumed) {
// 部分机型退出画中画不会回调 onPipChanged(false):回前台先兜底复位,
// 否则 chromeHidden 恒为 true,播放浮层与首页底栏都会消失。
if (pip || pipPreparing) {
pip = false;
pipPreparing = false;
notify();
notifyImmersive();
}
// 签名地址有有效期:回前台时若票据已过期,重新取一张再起播,
// 否则会撞上 403(契约 §1.4)
final episode = trackedEpisode;