Wayaer / fl_pip

flutter picture-in-picture plugin for ios and android
MIT License
27 stars 14 forks source link

FlPiP().disable(); 不起作用 #6

Closed jimonik closed 9 months ago

jimonik commented 1 year ago

进入pip模式之后,android其他flutter代码似乎不再被执行,主动调用FlPiP().disable(); 不能恢复,可以在example完善一下调用方式吗

jimonik commented 1 year ago

已解决,替换安卓的代码:

private fun foreground() { val returnIntent =activity. packageManager.getLaunchIntentForPackage(activity.applicationContext.packageName) returnIntent?.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP activity.startActivity(returnIntent) }

Wayaer commented 1 year ago

信你,你说可以咱就替换

jimonik commented 1 year ago

你可以验证一下其他手机,我这边安卓13没问题; 另外ios切换到pip就卡住了,重新打开app后pip倒计时就恢复了,看方便修复一下吗

Wayaer commented 1 year ago

可能是因为flutter版本的问题,之前好像是2.10上测试的,等有空我再看下

Wayaer commented 1 year ago

已经更新适配android,ios卡住目前没找到好的办法,可能是以为切换后台后 flutter引擎直接被严格限制运行了。

dhavalagile commented 11 months ago

check this solution

"disable" -> { enabledWhenBackground = false; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && activity.isInPictureInPictureMode) { launchApp() } result.success(true) }