title: How to change video url for MPMoviePlayerViewController?
body: <p>I am developing for iOS 6 using Xcode 4.6.1 (Target is iPad)</p>
  
  <p>I am trying to change the video URL when the user swipes the screen.</p>
  
  <p>This is my <code>ViewController.m</code> file:</p>
  
  <pre><code>#import "ViewController.h"
  
  @interface experiencesViewController () {
      MPMoviePlayerViewController *playerViewController;
      MPMoviePlayerController *player;
  }
  
  @end
  
  ...
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      // Do any additional setup after loading the view.
  
      NSString *url = [[NSBundle mainBundle] pathForResource:"video" ofType:@"mp4"];
  
      playerViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL fileURLWithPath:url]];
  
      player = [playerViewController moviePlayer];
      [player setMovieSourceType:MPMovieSourceTypeFile];
      player.fullscreen = YES;
  
      [player play];
  
      ...
  
  }
  
  ...
  </code></pre>
  
  <p>Now, I want to change the video on a swipe event. I tried doing this:</p>
  
  <pre><code>- (IBAction)didSwipeLeft:(UITapGestureRecognizer *)recognizer {
      NSLog(@"Left");
  
      player.movieSourceType = MPMovieSourceTypeFile;
      player.contentURL = [NSURL URLWithString:@"video2.mp4"];
  
      [player prepareToPlay];
      [player play];
  }
  </code></pre>
  
  <p>However, this doesn't work. The video stops playing and nothing happens after that. Any help would be highly appreciated.</p>
  
  <p>Thanks :)</p>