I would like to display an overlay image in PNG format with alpha channel on top of video playback. The PNG image can be for example a company logo. This is very easy to do when the video playback is on the phone. However, it seems I cannot control the external view when video is played back by AVPlayer in external playback mode (usesExternalPlaybackWhileExternalScreenIsActive = true, video is casted to TV via Apple TV or HDMI).
When my app is casted to Apple TV, I do find there are two UIScreens from the soure code (UIScreen.screens.count == 2), where one is my local phone device and one is my external 1080P screen. I followed the following link to add overlay content on the second screen but failed: https://developer.apple.com/documentation/uikit/windows_and_screens/displaying_content_on_a_connected_screen.
The problem is, when usesExternalPlaybackWhileExternalScreenIsActive = true, only the video playback is visible on the TV, nothing else. Only if I disable usesExternalPlaybackWhileExternalScreenIsActive, I could place whatever UIViews I want on the external screen. However, we are dealing with FPS protected content and flag usesExternalPlaybackWhileExternalScreenIsActive must set to be true to enable external playback of video.
Does anyone have clue how to place custom video on top of video playback in external playback mode? Thanks.