SPIndicator icon indicating copy to clipboard operation
SPIndicator copied to clipboard

Problem when the view has a AVPlayerViewController

Open PedroCavaleiro opened this issue 3 years ago • 2 comments

Details

  • iOS Version: 16.1.1
  • Framework Version: Branch Main
  • Installed via SPM

I'm trying to create a list of videos, each entry has a video player but using the library AZVideoPlayer for fullscreen and PiP support

There's a issue where the HUD goes under the notch

I was able to find out that the problem probably lies in the AVPlayerViewController, I tried to implement a simpler version of the video player with the AVPlayerViewController and got the same result, no issues when using the native VideoPlayer

https://user-images.githubusercontent.com/1993871/202064081-de4fd802-98e1-4d4b-b459-348af696a40c.mov

It's a bit hard to get a idea with the screen grab but the toast should cover the "Feed" word completely

I added the SPIndicator on the topmost view to see if it would helped but it doesn't

PedroCavaleiro avatar Nov 16 '22 02:11 PedroCavaleiro

Hi I had the same problem, as far I see weh you work with AVPlayer or AVPictureInPicture. Apple creates a UIWindow called PGHostedWindow that does not have safeAreaInsets. and this framework is using UIApplication.shared.windows.first to get the safe area insets instead of UIApplication.shared.connectedScenes .filter { $0.activationState == .foregroundActive } .first(where: { $0 is UIWindowScene }) .flatMap({ $0 as? UIWindowScene })?.windows .first(where: \.isKeyWindow)

what I suggest is create a fork with this change until they fix it :)

gvizeu avatar Jul 18 '23 09:07 gvizeu

Happy for any community changes. Soon will move this repo to pack with indicators

ivanvorobei avatar Jul 23 '23 11:07 ivanvorobei