I wrote an iOS app in swift. I am loading TikTok videos in an AVPlayerViewController using standard UIKit and AVKit. In my app the videos show perfectly fine - they fill the screen and preserve the original aspect ratios. However, when I screen mirror my device to my new Samsung Sero 43" tv and play the same videos they do NOT fill The Sero screen even though all other View Controllers of my app show on the Sero screen just fine in full screen when the Sero is in portrait orientation.
I experimented with setting the videoGravity of the player and also on a playerLayer in the viewDidiLoad to the 3 possible options and got these results:
videoGravity = .resize // stretches to full screen horizontally but compressed vertically = messed up aspect ratio
videoGravity = .resizeAspect // small video in the middle with correct aspect ratio
videoGravity = .resizeAspectFill // correct aspect ratio; filled horizontally but cut vertically at the top and the bottom. See attached image of The Sero
I tried also the picture settings on the Sero but there is nothing that can be set there to make my videos appear in full screen on The Sero.
Also, when I mirror videos straight from the TikTok app they look fine.
Can somebody help me solve this problem, please? I need to be able to play these TikTok videos in full screen on The Sero from my app. Is there perhaps a better video player for swift than the AVplayer that I should use?