I have an application that transfers video from a network and plays it using the MPMoviePlayerController
object to play on the device or through AirPlay.
The application supports background control and has an “audio” parameter specified within the required UIBackgroundModes
key in its plist file.
When playing AirPlay, the application can be successfully transferred to the background, and the video continues to play correctly. So far so good.
According to Apple documentation :
Turning on the sound key tells the system frameworks that they should continue playing and make the necessary callbacks in the application at appropriate intervals. If the application does not include this key, any sound when playing the application stops when the application moves to the background.
However, these callbacks are not performed.
The application uses two types of callbacks: those associated with MPMoviePlayerController
and AVPlayer
notifications MPMoviePlayerController
sent during playback along with timer callbacks that control the playback position and performance statistics for monitoring purposes.
Looking at Apple's notes, I would certainly expect to get the first type of callback so that the application can respond to MPMoviePlayerPlaybackStateDidChangeNotification
, MPMoviePlayerPlaybackDidFinishNotification
and MPMoviePlayerLoadStateDidChangeNotification
, but this does not happen.
Does anyone know if they can be obtained during background playback of AirPlay, and if so, how was this achieved?
** Please note: the application works correctly when launched in the foreground and receives a fine notification. Only when you click on the background and play AirPlay notifications are not accepted.
Similarly, video plays over AirPlay in the background. These are only notifications that are not accepted **