I cannot comment, so I had to post this as an answer, although it may not fully answer the questions.
I had a similar problem, and in the end I found out that when AVPlayer plays AVComposition , it just doesn't display anything on the external display. That's why I had to do it myself, listening to UIScreen connection notifications.
I have to say that everything worked pretty well. First, I check if there is more than one screen, and if there is, I simply move AVPlayer on this screen when a simple message is displayed on the screen of the device on which the content is played ... plus the name of the AirPlay device. That way, I can place anything I want on an external display and not very difficult. The same thing happens when I get UIScreenDidConnectNotification .
It was beautiful until I noticed that the composition played on the remote control appearance. Even if it consists of only one video without any complex changes or overlays. The same video plays perfectly if I save it in Camera Roll or if I use MPMoviePlayerController .
I have tried many things, such as lowering the resolution, lowering the renderScale , etc., but without success.
Iβm more worried about how Apple does this in iMovie - if you have AirPlay turned on and you play the project (note that it still doesnβt appear, so it must use the composition to display it) right after clicking the play button it opens a player that plays content really smoothly on an external monitor. If you, however, activate AirPlay from a player, it closes and starts rendering the project. After that, he plays just that, using MPMoviePlayerController.
I am still trying to find a solution and will send a message if I have any success.
So, for two questions:
- I do not understand why you need to get rid.
- Yes, it can be played, but with a different technique and, obviously, problems.
source share