title: Stream Audio with AVPlayer
body: <p>I'm trying to play audio from a URL using AVPlayer when a row is selected in a table view but it doesn't play. What am I doing wrong?</p>
  
  <p>Here is the code:</p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {
      NSString *streamingString = [NSString stringWithFormat:@"%@.json?client_id=fc886d005e29ba78f046e5474e3fdefb", [streamURLArray objectAtIndex:indexPath.row]];
      NSURL *streamingURL = [NSURL URLWithString:streamingString];
      NSLog(@"%@", streamingURL);
      AVPlayer *player = [AVPlayer playerWithURL:streamingURL];
      [player play];
      player.actionAtItemEnd = AVPlayerActionAtItemEndNone;
  }
  </code></pre>
  
  <p>An example of streamingURL when I log it is this.</p>
  
  <pre><code>http://api.soundcloud.com/tracks/146814101/stream.json?client_id=fc886d005e29ba78f046e5474e3fdefb
  </code></pre>