title: MPMoviePlayerController gives an error while playing stream in iOS
body: <p>I want to play a live stream video from an url in MPMoviePlayerController. I got the link with playing the video on UIWebView. UIWebView gives an output when it launches a MPMoviePlayerController, as NSLog. And it plays the stream without any problems!</p>
  
  <pre><code>setting movie path:
  http://ibbtks.noc.com.tr/ibbesm/bagdat2lq.stream/playlist.m3u8?k=ffd81df8cfee8f9259eff91dc9a483c4
  </code></pre>
  
  <p>I got that video url from NSLog, and put it into a MPMoviePlayerController. That's code that I used,</p>
  
  <pre><code>- (void)playMovie
  {    
      NSURL* myUrl = [NSURL URLWithString:@"http://ibbtks.noc.com.tr/ibbesm/kadikoylq.stream/playlist.m3u8"];
  
      NSURL* appleUrl = [NSURL URLWithString:@"http://devimages.apple.com/iphone/samples/bipbop/gear4/prog_index.m3u8"];
  
      _moviePlayer =  [[MPMoviePlayerController alloc]
                       initWithContentURL:myUrl];
  
      [[NSNotificationCenter defaultCenter] addObserver:self
                                               selector:@selector(moviePlayBackDidFinish:)
                                                   name:MPMoviePlayerPlaybackDidFinishNotification
                                                 object:_moviePlayer];
  
      _moviePlayer.controlStyle = MPMovieControlStyleDefault;
      _moviePlayer.shouldAutoplay = YES;
      _moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;
      [self.view addSubview:_moviePlayer.view];
      [_moviePlayer setFullscreen:YES animated:YES];
  }
  </code></pre>
  
  <p>It plays the appleUrl stream with no problem, but when I try to play myUrl, it's always loading and it gives an error. The error output is,</p>
  
  <pre><code>Did finish with error: Error Domain=MediaPlayerErrorDomain Code=-11800 "The operation could not be completed" UserInfo=0x99a9760 {NSLocalizedDescription=The operation could not be completed}
  </code></pre>
  
  <p>When I try to play this link on UIWebView or safari, it plays the video successfully, and as I said, it gives me the url as NSLog that I used. But when I try to play this url myself, I got an error. Any suggestions?</p>
  
  <p>Thanks in advance.</p>