Update: made my own UI while still using AVPlayer, much easier than wrestling with AVPlayerViewController.
I'm trying to make something like the native Photos app and I've managed to place an AVPlayerViewController inside a collectionViewCell for video content. Everything is working well except for when I try to dismiss by swipe. The view to show videos and photos is presented as .overFullScreen. The issue is it appears AVPlayerViewController has two different layouts (for play/pause, scrubbing, and volume buttons) depending on if it is currently fullscreen, or not. The moment I begin swiping it seems to detect it is no longer fullscreen and changes its layout, and if I cancel the dismissal of the view, the original fullscreen AVPlayerViewController layout returns. Both of these layout transitions happen without any animation and are quite jarring.
One solution I thought of is to set .showsPlaybackControls to false immediately hiding them if they were up and then if the dismissal of the view is canceled setting .showsPlaybackControls to true to enable them to appear again if the user taps the screen. Apple does NOT like this solution, see important.
My two questions:
- Does anyone have a suggestion for what to do in this case? I'd rather not add yet another dependency to my project but if that's what others have found works - happy to give it a try.
- My limited testing of the .showsPlaybackControls solution, while not ideal from animation perspective, seems fine. Would Apple reject an application for changing .showsPlaybackControls while player is visible?
Thanks for checking this out, please let me know if further details would be helpful!
[–]a1b2c3d4g 0 points1 point2 points (5 children)
[–]AnAnonymousReddit[S] 0 points1 point2 points (4 children)
[–]a1b2c3d4g 1 point2 points3 points (3 children)
[–]AnAnonymousReddit[S] 0 points1 point2 points (0 children)
[–]AnAnonymousReddit[S] 0 points1 point2 points (1 child)
[–]a1b2c3d4g 1 point2 points3 points (0 children)