AVPlayer-SwiftUI
AVPlayer-SwiftUI copied to clipboard
Video view is square and has grey borders
In this example when playing the video, the video view is square (375 * 375) and has the video inside it with grey borders top and bottom.
How can I get rid of those grey borders and have the video view hug the borders of the video itself?
Hi Douglas! It's a good question! I know you can get the render size of the video from AVPlayer and I imagine UIViewRepresentable can be told that size so the view only takes the required space, though it's not something I've tried myself!
I assume SwiftUI's VideoPlayer takes care of this for you, so maybe you'd be able to use that instead of going into UIKit?