title: UIImagePickerController and application background modes
body: <p>I’m building an application which supports both video playback and recording (not simultaneously, it’s just two separate features it provides). In order to make the videos play after the app enters background and gets back, I had to add an <code>App plays audio</code> item to <code>Required background modes</code> in the plist (I’m using <code>MPMoviePlayerController</code> for playback). </p>
  
  <p>This, however, causes a problem with my video recording (I’m using <code>UIImagePickerController</code> for it). Basically, even after the picker is dismissed (either by the Cancel button or when it’s finished picking media), the app still keeps the audio recording session running.</p>
  
  <p>If I remove the <code>App plays audio</code> item from the plist, the ImagePickerController’s audio session stops misbehaving, but then I can’t resume the playback of <code>MPMoviePlayerViewController</code> on switching to app from background mode.</p>
  
  <p>Is there a way I can customise the handling of the audio session so that both the <code>MPMoviePlayerController</code> and <code>UIImagePickerController</code> can work properly?</p>