title: AVAudioPlayer and AirPlay - possible?
body: <p>I'm trying to ascertain whether it's possible to toggle AirPlay support using the <code>AVAudioPlayer</code> class.</p>
  
  <p>From what I have read:</p>
  
  <blockquote>
    <p>AirPlay is a technology that lets your application stream audio to Apple TV and to third-party AirPlay speakers and receivers. AirPlay support is built in to the <code>AV Foundation</code> framework and the <code>Core Audio</code> family of frameworks. Any audio content you play using these frameworks is automatically made eligible for AirPlay distribution. Once the user chooses to play your audio using AirPlay, it is routed automatically by the system. [ <a href="http://developer.apple.com/library/ios/#documentation/Miscellaneous/Conceptual/iPhoneOSTechOverview/MediaLayer/MediaLayer.html#//apple_ref/doc/uid/TP40007898-CH9-SW18" rel="nofollow">Ref</a> ]</p>
  </blockquote>
  
  <p>Based on this info; it <em>should</em> work with AVAudioPlayer as it is part of the <code>AVFoundation</code> framework; but I can't seem to find any documentation supporting this assumption.</p>
  
  <p>I have also found some documentation saying it can be done with <code>MPMoviePlayerViewController</code>:</p>
  
  <blockquote>
    <p>Support for playing video using AirPlay is included in the <code>MPMoviePlayerController</code> class. This support allows you to play video-based content on AirPlay–enabled hardware such as Apple TV. When the <code>allowsAirPlay</code> property of an active <code>MPMoviePlayerController</code> object is set to <code>YES</code> and the device is in range of AirPlay–enabled hardware, the movie player presents the user with a control for sending the video to that hardware. [ <a href="http://developer.apple.com/library/ios/#releasenotes/General/WhatsNewIniPhoneOS/Articles/iOS4_3.html#//apple_ref/doc/uid/TP40010567-SW2" rel="nofollow">Ref</a> ]</p>
  </blockquote>
  
  <p>Seems like there is some conflicting information here. Does anyone know if its possible to use <code>AVAudioPlayer</code> to route to AirPlay or are we forced to use the <code>MPMoviePlayerController</code> class?</p>
  
  <p>Thanks very much.</p>