uakihir0 / UIPiPView

This library is a UIView that is capable of Picture-in-Picture (PiP) in iOS.
MIT License
219 stars 32 forks source link

Support canStartPictureInPictureAutomaticallyFromInline #10

Open WillBishop opened 2 years ago

WillBishop commented 2 years ago

Hello,

In iOS 14.2, Apple added canStartPictureInPictureAutomaticallyFromInline, so developers don't have to explicitly call PiP methods from lifecycle functions.

This would fit great in my app, where the user may leave the app without enabling PiP, where it would still be beneficial to have it. I tried to fork the repo and add canStartPictureInPictureAutomaticallyFromInline to the pipController, but it didn't work.

uakihir0 commented 2 years ago

Hi.

In UIPiPView, what is displayed in the PiP is set by explicitly calling a rendering function.

Therefore, even if canStartPictureInPictureAutomaticallyFromInline is set, PiP will not be executed because the rendering content does not exist.

I will try to create a function that will work.