title: iOS: Live Streaming AVPlayer
body: <p>I wanted to stream a song from a server, which seems to work just fine with the way that I have done it, but there are some things that don't seem possible with this approach.</p>
  
  <p>I've currently instantiated an AVPlayer</p>
  
  <pre><code>player = [[AVPlayer alloc] initWithURL:[NSURL URLWithString:@"http://media.soundcloud.com/stream/songID?stream_token=myToken"]];
  </code></pre>
  
  <p>And called play on it when my application deems the buffer to be sufficient.</p>
  
  <p>This plays the sound perfectly fine, but I'm finding that if I stop pointing to the AVPlayer instance, the player stops and if I push the application to the background, the sound fades and pauses until the application comes back to the foreground.</p>
  
  <p>Is it possible to have the song keep playing in the background with AVPlayer?</p>
  
  <p>If not, should I be looking at <a href="https://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/Introduction/Introduction.html" rel="nofollow">HTTP Live Streaming</a> instead?</p>
  
  <p>I'm very new to this side of iOS and I would greatly appreciate any guidance my fellow SO-ers can give me!</p>