title: MPMoviePlayerController error _itemFailedToPlayToEnd while playing youtube video iOS 7
body: <p>I've seen this mentioned a few places around the web but have yet to find answer anywhere.</p>
  
  <p>I am using <a href="https://www.cocoacontrols.com/controls/almovieplayercontroller" rel="nofollow">ALMovieplayercontroller</a> library. Everything works fine but when i am trying to play Youtube video it gives me error.</p>
  
  <p><strong>_itemFailedToPlayToEnd: {
      kind = 1;
      new = 2;
      old = 0;
  }</strong></p>
  
  <p><strong>EDIT</strong></p>
  
  <pre><code>- (void)setContentURL:(NSURL *)contentURL {
  
      self.movieSourceType = MPMovieSourceTypeStreaming;
      [super setContentURL:contentURL];
      [[NSNotificationCenter defaultCenter] postNotificationName:ALMoviePlayerContentURLDidChangeNotification object:nil];
      [self play];
  }
  </code></pre>
  
  <p><strong>Here is my code</strong></p>
  
  <pre><code>ALMoviePlayerControls *movieControls = [[ALMoviePlayerControls alloc] initWithMoviePlayer:self.moviePlayer style:ALMoviePlayerControlsStyleDefault];
  //[movieControls setAdjustsFullscreenImage:NO];
  [movieControls setBarColor:[UIColor colorWithRed:195/255.0 green:29/255.0 blue:29/255.0 alpha:0.5]];
  [movieControls setTimeRemainingDecrements:YES];
  
  //assign controls
  [self.moviePlayer setControls:movieControls];
  [self.view addSubview:self.moviePlayer.view];
  self.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;
  
  //THEN set contentURL
  [self.moviePlayer setContentURL:[NSURL URLWithString:@"http://www.youtube.com/watch?v=NaosmAGx8NM"]];
  </code></pre>
  
  <p>I am not able to find the solution for this.</p>
  
  <p>Please Help.</p>