title: How do I stop AirPlay audio with AVPlayer?
body: <p>I'm working on an iOS app that, for reasons we won't get into here, wants to sometimes disable AirPlay playback on a remote device, and only play video locally on the iOS device, regardless of the user's settings.</p>
  
  <p>I'm using AVPlayer to play the video, and that's currently non-negotiable.</p>
  
  <p>I'm setting the iOS 5.0+ AVPlayer property allowsAirPlayVideo to NO, which prevents the video from playing remotely. But if the user has turned on AirPlay on the iOS device, the audio is still streamed through the remote device.</p>
  
  <p>I don't see a comparable allowsAirPlayAudio flag in Apple's documentation, nor have I found mention of this issue anywhere else.</p>
  
  <p>For example, this Stack Overflow question:</p>
  
  <p><a href="https://stackoverflow.com/questions/8379081/audio-output-routes-for-airplay">Audio Output Routes for AirPlay</a></p>
  
  <p>talks about "audio output destinations in a USB audio accessory", which doesn't sound like what I need.</p>
  
  <p>I don't want to just turn off audio, I want the audio to keep being played through my iOS device.</p>
  
  <p>Am I missing something? Thanks!</p>