title: Pre-Roll Video Ad with AVPlayerViewController
body: <p>I'm having a problem with iAd's Pre-Roll Video Ad.</p>
  
  <pre><code>- (void)viewDidLoad {
      [super viewDidLoad];
  
      self.canDisplayBannerAds = YES;
  
      NSURL *url = [NSURL URLWithString:@"http://www.ebookfrenzy.com/ios_book/movie/movie.mov"];
      player = [[AVPlayerViewController alloc] init];
      player.showsPlaybackControls = YES;
      AVPlayer *playerP = [[AVPlayer alloc] initWithURL:url];
  
      player.player = playerP;
      player.delegate = self;
  }
  
  - (IBAction)buttonClick:(id)sender {
      [self presentViewController:player animated:YES completion:^{
          [player playPrerollAdWithCompletionHandler:^(NSError *error) {
  
              if (error != nil) {
                  NSLog(@"Error Message: %@", error);
              }
          }];
          NSLog(@"Completion");
      }];
  }
  </code></pre>
  
  <p>I am getting the following error when running:</p>
  
  <blockquote>
    <p>Error Domain=ADErrorDomain Code=0 "(null)"</p>
  </blockquote>
  
  <p>The iAd Pre-Roll Video Ad is not displayed. I followed this documentation:
  <a href="https://developer.apple.com/iad/resources/Implementing-iAd-in-Your-iOS-Apps.PDF" rel="nofollow">Monetizing your   iOS apps with iAd</a></p>
  
  <p>I also allowed <code>Arbitrary Loads</code> in my <code>info.plist</code></p>
  
  <pre><code>&lt;key&gt;NSAppTransportSecurity&lt;/key&gt;
      &lt;dict&gt;
          &lt;key&gt;NSAllowsArbitraryLoads&lt;/key&gt;
          &lt;true/&gt;
      &lt;/dict&gt;
  </code></pre>