title: IOS [NSURL initFileURLWithPath:]: nil string parameter on loading video
body: <p>I have a problem with my video content. I want to load a video from my viewcontroller and I get this error:
  [NSURL initFileURLWithPath:]: nil string parameter
  When I try to load the video from a url the video wont show up.</p>
  
  <p>I am sure that my variable targetURN is not nil.</p>
  
  <p>From here I load my viewcontroller:</p>
  
  <pre><code>- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
  {
      switch (buttonIndex) {
          case 0:
              [self openVideoView:@"Video"];
          break;
          case 1:
              [self openWebview:@"About"];
          break;
          case 2:
              [self openWebview:@"http://www.url.com"];
          break;
      }
  }
  
  - (void)openVideoView:(NSString *)url{
      IDPVideoView *vv = [[IDPVideoView alloc] initWithURN:url];
      [self presentModalViewController:vv animated:NO];    
  }
  </code></pre>
  
  <p>In my viewcontroller:</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
      NSURL *videoURL = nil;
  
      if ([self.targetURN hasPrefix:@"http"])
      {
          videoURL = [NSURL URLWithString:targetURN];
      }
      else
      {
          videoURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:targetURN ofType:@"mp4"]];
      }
      if(videoURL != nil) {
          MPMoviePlayerController *moviePlayer = 
          [[MPMoviePlayerController alloc] initWithContentURL:videoURL];
          [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayer];
  
          moviePlayer.controlStyle = MPMovieControlStyleDefault;
          moviePlayer.shouldAutoplay = YES;
          [moviePlayer prepareToPlay];
          [self.view addSubview:moviePlayer.view];
          [moviePlayer setFullscreen:YES animated:YES];
      }
  }
  </code></pre>