title: expected expression error within function
body: <p>So I am trying to write a function that is pretty much just an IBAction that plays a media player. This is necessary in the code that I am writing as there will be multiple videos being used so to make my code more concise, I'd like to write the function so that the code for the media player goes in once instead of several times. When I try the code below, it states that I have an error on the IBAction stating "expected expression." any ideas? Also included in the code is a commented out if statement that does not work. Essentially I would like it so that when I click the default "done" button provided in the fullscreen media player, the window will close. Right now all the done button does is stop the video but I want the media player to close as well.</p>
  
  <pre><code>void moviePlayer (id vidName, id type);
  
  void moviePlayer (id vidName, id type){
  
  
  -(IBAction)playMovie{
  
  
  NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle]pathForResource:@"vidName" ofType:@"type"]];
  
  MPMoviePlayerController *playerViewController = [[MPMoviePlayerController alloc] init];
  playerViewController.contentURL = url;
  if (self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft || self.interfaceOrientation == UIInterfaceOrientationLandscapeRight){
      playerViewController.view.frame = CGRectMake(0, 0, 1030, 768);
  }
  else{
      playerViewController.view.frame = CGRectMake(0,0, 768, 1004);
  }
  [playerViewController setControlStyle: MPMovieControlStyleFullscreen];
  [playerViewController setScalingMode:MPMovieScalingModeAspectFit];
  playerViewController.view.AutoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
  [self.view addSubview:playerViewController.view];
  [playerViewController play];
  /*if (playerViewController == stop){
   [self.playerViewController.view removeFromSuperview];
  
   }*/
  
  self.playerViewController = playerViewController;
  
  
  }
  }
  </code></pre>