Closed huantd0111 closed 1 year ago
The ios emulator cannot support the picture-in-picture mode, and must use the real machine, Switch background and look at this
Additionally, I'd appreciate more clarification on the
toggle
method. The documentation for this method seems unclear, and I'm having trouble understanding how to implement it on both Android and iOS.
Thankiu @Wayaer Additionally, I'd appreciate more clarification on the toggle method. The documentation for this method seems unclear, and I'm having trouble understanding how to implement it on both Android and iOS.
On android, the toggle method can make the app enter the background or foreground by calling the code, but on ios, it can only be switched to the background. After this, it has nothing to do with the picture-in-picture mode
Here's this code in example, when you go into picture-in-picture mode, the app goes into the background
Here's this code in example, when you go into picture-in-picture mode, the app goes into the background
Previously, I had read through the example and implemented this library on Android. However, I didn't call "FlPiP().toggle(AppState.background);" and yet the PIP mode was still activated. I will try the example again and gain a clearer understanding of the "toggle" method's functionality. Thanks once again for your swift response and assistance.
Here's this code in example, when you go into picture-in-picture mode, the app goes into the background
Previously, I had read through the example and implemented this library on Android. However, I didn't call "FlPiP().toggle(AppState.background);" and yet the PIP mode was still activated. I will try the example again and gain a clearer understanding of the "toggle" method's functionality. Thanks once again for your swift response and assistance.
Hi @Wayaer I retested the sample application and observed that when I call "FlPiP().toggle(AppState.background);," the app indeed goes into the background. Additionally, I commented out the content of the listener method, and the PIP functionality still works as expected. So, my question is: what is the purpose of your check:
if (FlPiP().status.value == PiPStatus.enabled) {
FlPiP().toggle(AppState.background);
}
Does it serve a specific purpose, perhaps for the iOS platform? Because from what I observed, this listener and action seem redundant on Android.
Thank you for your prompt responses and guidance.
On android, the app will automatically enter the background when you enable the picture-in-picture mode, but when you use the enableWithEngine
method, it will not automatically enter the background, and on ios, whether you call either of the two will not automatically enter the background.
enableWithEngine
and enable
both use the picture-in-picture function in ios, but the windows manager used by the former in android is not a native picture-in-picture mode
@Wayaer Thank you for your assistance, I have resolved the issue. However, I would appreciate it if you could update the information we discussed in the library's document. This could be helpful for newcomers who access the library.
I'm trying to test the
fl_pip
package on the iOS Simulator, but I'm encountering an error that says "PiP unavailable." I've followed the instructions in the iOS configuration section, where I added Background Modes and checked Audio, AirPlay, and Picture in Picture capabilities.Steps to Reproduce:
Expected Behavior:
I expect to be able to test the
fl_pip
package successfully on the iOS Simulator without encountering the "PiP unavailable" error.Additional Notes:
Additionally, I'd appreciate more clarification on the
toggle
method. The documentation for this method seems unclear, and I'm having trouble understanding how to implement it on both Android and iOS. I'm interested in implementing an automatic PiP mode when the app is swiped into the background on iOS, similar to the behavior seen in the YouTube app. Is there a way to achieve this using thefl_pip
package?I tried referring to the discussion in this GitHub issue, but I'm facing difficulties when attempting to test this directly on the iOS Simulator. The issue arises even before I can properly test the solution mentioned.
Questions:
Thank you for your assistance!