title: iOS 8 stops streaming audio in background after 10 minutes
body: <p>I have an app that plays streaming audio from a SHOUTcast server. Everything works fine when the app is on the foreground and auto-lock is disabled. The app is however also able to play audio in the background, this feature has always been working fine on iOS 6 and iOS 7. But now my users are reporting that background audio stops after about 10 minutes after they upgraded to iOS 8.</p>
  
  <p>I'm able to reproduce the problem myself by simply running the app on iOS 8. Since the app itself is pretty complicated, I've made a simple demo to show the problem. I'm using Xcode 6 and Base SDK is set to iOS 8. I've added <em>audio</em> to <em>UIBackgroundModes</em> in my Info.plist. Does anybody know what's wrong with the code below?</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
      NSURL *streamingURL = [NSURL URLWithString:@"http://www.radiofmgold.be/stream.php?ext=pls"];
  
      AVPlayerItem *playerItem = [AVPlayerItem playerItemWithURL:streamingURL];
      [self setPlayerItem:playerItem];
  
      AVPlayer *player = [AVPlayer playerWithPlayerItem:playerItem];
      [player setAllowsExternalPlayback:NO];
  
      [self setPlayer:player];
      [player play];
  
      [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
      [[AVAudioSession sharedInstance] setActive: YES error: nil];
  
      return YES;
  }
  </code></pre>