I use AVPlayer to play video on my SwiftUI project but I notice the video has black layouts around it. Here is how it looks like:
Here is the code:
struct ContentView: View {
public var body: some View {
VideoPlayer(player: AVPlayer(url: URL(string: "https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/360/Big_Buck_Bunny_360_10s_1MB.mp4")!))
.frame(maxWidth: .infinity)
.frame(height: 350)
}
}
How do I remove the black layout?