title: MPMoviePlayerController won't play when using Storyboard / Shows black screen
body: <p>I was trying to play a video in background in my app, but it didn't work when I was using Storyboard. I read something about ARC and tried everything, but my video won't simply play. I tried the exact same thing but with another project where I deleted the Storyboard-file, and there it worked. I need to use this in my project where I'm using Storyboard. Please help me.</p>
  
  <p>Here's the code: </p>
  
  <p><strong>ViewController.m:</strong></p>
  
  <pre><code>#import "AnimatedLoginViewController.h"
  #import &lt;AVFoundation/AVFoundation.h&gt;
  #import &lt;MediaPlayer/MediaPlayer.h&gt;
  #import &lt;QuartzCore/QuartzCore.h&gt;
  
  @interface ViewController (){
      MPMoviePlayerController *player;
  }
  
  @property (nonatomic, strong) MPMoviePlayerController *player;
  
  @end
  
  @implementation ViewController
  
  @synthesize player;
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
  
      CGRect screen = [[UIScreen mainScreen] bounds];
  
      NSURL *movieUrl = [[NSBundle mainBundle] URLForResource:@"background"  withExtension:@"mp4"];
  
      self.player = [[MPMoviePlayerController alloc] initWithContentURL:movieUrl];
  
      player.view.frame = screen;
      player.scalingMode = MPMovieScalingModeFill;
      [self.player setControlStyle:MPMovieControlStyleNone];
      [self.view addSubview:player.view];
      [player prepareToPlay];
  
  
      UIImageView *logo = [[UIImageView alloc] initWithFrame:CGRectMake(65, 90, 190, 40)];
      logo.backgroundColor = [UIColor clearColor];
      [logo setImage:[UIImage imageNamed:@"logo_welcome.png"]];
  
      [self.view addSubview:logo];
  
  
      UIFont *boldFont = [UIFont fontWithName:@"HelveticaNeue-Bold" size:16.0];
      UIFont *defaultFont = [UIFont fontWithName:@"HelveticaNeue" size:16.0];
  
  
      NSDictionary * attributes = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[UIColor whiteColor], defaultFont, nil] forKeys:[NSArray arrayWithObjects:NSForegroundColorAttributeName, NSFontAttributeName, nil]];
  
      NSDictionary * attributesBold = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[UIColor whiteColor], boldFont, nil] forKeys:[NSArray arrayWithObjects:NSForegroundColorAttributeName, NSFontAttributeName, nil]];
  
      attributes = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[UIColor blackColor], defaultFont, nil] forKeys:[NSArray arrayWithObjects:NSForegroundColorAttributeName, NSFontAttributeName, nil]];
  
      attributesBold = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[UIColor blackColor], boldFont, nil] forKeys:[NSArray arrayWithObjects:NSForegroundColorAttributeName, NSFontAttributeName, nil]];
  
      UIButton *emailButton = [UIButton buttonWithType:UIButtonTypeCustom];
      [emailButton setFrame:CGRectMake(10, screen.size.height==568?455:370, 300, 43)];
  
      attributedString = [[NSMutableAttributedString alloc] init];
      [attributedString appendAttributedString:[[NSAttributedString alloc] initWithString:@"Enter your work " attributes:attributes]];
  
      [attributedString appendAttributedString:[[NSAttributedString alloc] initWithString:@"Email" attributes:attributesBold]];
      [emailButton setAttributedTitle:attributedString forState:UIControlStateNormal];
  
      [emailButton setBackgroundImage:[UIImage imageNamed:@"SignInMailButton.png"] forState:UIControlStateNormal];
      [emailButton setBackgroundImage:[UIImage imageNamed:@"SignInMailButtonTap.png"] forState:UIControlStateHighlighted];
      [emailButton setBackgroundImage:[UIImage imageNamed:@"SignInMailButtonTap.png"] forState:UIControlStateSelected];
      [emailButton setEnabled:YES];
      [self.view addSubview:emailButton];
  
  
      boldFont = [UIFont fontWithName:@"HelveticaNeue-Bold" size:14.0];
      defaultFont = [UIFont fontWithName:@"HelveticaNeue" size:14.0];
  
      attributes = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[UIColor grayColor], defaultFont, nil] forKeys:[NSArray arrayWithObjects:NSForegroundColorAttributeName, NSFontAttributeName, nil]];
  
      attributesBold = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[UIColor whiteColor], boldFont, nil] forKeys:[NSArray arrayWithObjects:NSForegroundColorAttributeName, NSFontAttributeName, nil]];
  
      UIButton *signInButton = [UIButton buttonWithType:UIButtonTypeCustom];
      [signInButton setFrame:CGRectMake(10, screen.size.height==568?500:410, 300, 43)];
  
      attributedString = [[NSMutableAttributedString alloc] init];
      [attributedString appendAttributedString:[[NSAttributedString alloc] initWithString:@"Do you have an activation code? " attributes:attributes]];
  
      [attributedString appendAttributedString:[[NSAttributedString alloc] initWithString:@"Enter now" attributes:attributesBold]];
      [signInButton setAttributedTitle:attributedString forState:UIControlStateNormal];
      [signInButton setEnabled:YES];
      [self.view addSubview:signInButton];
  
  
      [[NSNotificationCenter defaultCenter] addObserver:self
                                               selector:@selector(playVideo)
                                                   name:MPMoviePlayerReadyForDisplayDidChangeNotification
                                                 object:player];
  
      [[NSNotificationCenter defaultCenter] addObserver:self
                                               selector:@selector(moviePlayerDidFinish:)
                                                   name:MPMoviePlayerPlaybackDidFinishNotification
                                                 object:self.player];
  
      [player play];
  }
  
  - (void)moviePlayerDidFinish:(NSNotification *)note
  {
      if (note.object == self.player) {
          NSInteger reason = [[note.userInfo objectForKey:MPMoviePlayerPlaybackDidFinishReasonUserInfoKey] integerValue];
          if (reason == MPMovieFinishReasonPlaybackEnded)
          {
              [self.player play];
          }
      }
  }
  
  -(void)playVideo{
      [player play];
  }
  
  @end
  </code></pre>