I am trying to figure out if it is possible to switch AirPlay support using the AVAudioPlayer
class.
From what I read:
AirPlay is a technology that allows your application to stream audio to Apple TV and third-party speakers and AirPlay receivers. AirPlay support is built into the AV Foundation
and the Core Audio
family of frames. Any audio content that you play using these frameworks automatically gets the right to distribute AirPlay. After the user wants to play audio using AirPlay, he is automatically routed by the system. [ Ref ]
Based on this information; It should work with AVAudioPlayer, as it is part of the AVFoundation
; but I canβt find documentation supporting this assumption.
I also found some documentation that says that this can be done using MPMoviePlayerViewController
:
Support for playing videos using AirPlay is included in the MPMoviePlayerController
class. This support allows you to play video content on AirPlay-enabled equipment such as Apple TV. If the allowsAirPlay
property of the active allowsAirPlay
object MPMoviePlayerController
set to YES
and the device is in the range of hardware supported by AirPlay, the video player provides the user with a control for sending video to this equipment. [ Ref ]
There seems to be some conflicting information here. Does anyone know if AVAudioPlayer
can be used to route to AirPlay or are we forced to use the MPMoviePlayerController
class?
Thank you very much.
source share