AVComposition crashes about Airplay

I have a video composition that I would like to play in Airplay (without mirroring). The application works as expected when using normal mirroring in Airplay, but I would like to get the speed, reliability and resolution that you get from using Airplay videos.

The problem is that when I install

player.usesAirPlayVideoWhileAirPlayScreenIsActive = YES; 

... player is empty.

Notes:

  • Since I do not create separate windows for each display, they both try to use the same AVPlayer.
  • My AVVideoComposition contains different files and adds frames between them.
  • This unanswered question suggests that the problem is more likely due to the fact that I lose AVComposition than using a common player: AVComposition does not play through Airplay Video

Two questions:

  • Should I get rid of the player on the iPad?
  • Can AVVideoComposition ever play on AirPlay?
+4
source share
2 answers

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.
0
source

in the .plist application create a new element:

required background modes

add a new array element called:

App plays audio or streams audio/video using AirPlay

Not sure if you've tried this already, but don't mention it in your post.

Hooray!

0
source

All Articles