title: How to play hls streaming on xcode
body: <p>I am very new to xcode and I am trying to execute simple video app that will play hls url.</p>
  
  <p>I googled and found one that plays a local video file. I tried if it will work with hls url (.m3u8) but it didn't</p>
  
  <p>Here is the code I have so far.</p>
  
  <pre><code>-(IBAction)playvideo {
  NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle]
  pathForResource:@"http://mysite.com:1935/live/channel1/playlist.m3u8" ofType:@"mp4"]];
  MPMoviePlayerViewController *playercontroller = [[MPMoviePlayerViewController alloc]
  initWithContentURL:url];
  [self presentMoviePlayerViewControllerAnimated:playercontroller];
  playercontroller.moviePlayer.movieSourceType = MPMovieSourceTypeFile;
  [playercontroller.moviePlayer play];
  playercontroller = nil;
  }
  </code></pre>
  
  <p>I am getting this error.</p>
  
  <pre><code>VideoPlayTest[16276:c07] *** Terminating app due to uncaught exception     'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string     parameter'
  </code></pre>
  
  <p>I am using latest xcode on mountain lion.</p>
  
  <p>Thanks</p>