title: Video is not playing in ios8 using AVPlayer
body: <p>Video stored in <code>documents</code> <code>directory</code> is not playing if i run app in <code>ios8</code> but works perfect if i run in <code>ios7</code></p>
  
  <p>I am downloading video in <code>documents</code> <code>directory</code> using <code>AFNetworking</code>.Here is the code.</p>
  
  <pre><code>NSURLRequest *request = [NSURLRequest requestWithURL:urlVideo];
  AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
  NSString *path = [dataPath stringByAppendingPathComponent:[urlVideo lastPathComponent]];
  operation.outputStream = [NSOutputStream outputStreamToFileAtPath:path append:NO];
  [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
                  self.isDownloadingComplete = YES;
              } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
                  NSLog(@"Video Downloading Failed");
              }];
              [operation start];
  </code></pre>
  
  <p>And i am playing that downloaded <code>video</code> using <code>AVPlayer</code>. Here is the code.</p>
  
  <pre><code>NSURL* playbackURL = [[NSURL alloc] initFileURLWithPath:strPath isDirectory:NO];
  [[NSNotificationCenter defaultCenter] removeObserver:self name:AVPlayerItemDidPlayToEndTimeNotification object:[_pl currentItem]];
  [[NSNotificationCenter defaultCenter] addObserver:self
                                           selector:@selector(playerItemDidReachEnd:)
                                               name:AVPlayerItemDidPlayToEndTimeNotification
                                             object:[_pl currentItem]];
  
  
  AVAsset *asset = [AVURLAsset URLAssetWithURL:playbackURL options:nil];
  AVPlayerItem *anItem = [AVPlayerItem playerItemWithAsset:asset];
  _pl = [AVPlayer playerWithPlayerItem:anItem];
  _pl.volume = 1.0;
  _pl.actionAtItemEnd = AVPlayerActionAtItemEndNone;
  AVPlayerLayer *layer = [AVPlayerLayer playerLayerWithPlayer:_pl];
  layer.videoGravity = AVLayerVideoGravityResizeAspectFill;
  layer.frame = CGRectMake(0, 0, 305, 306);
  [self.contentView.layer addSublayer: layer];
  [_pl play];
  </code></pre>
  
  <p>I think issue is with Documents Directory as i run the app, the document path is changing every time, but i am sending correct path every time. Here is reference: <a href="http://pinkstone.co.uk/where-is-the-documents-directory-for-the-ios-8-simulator/" rel="nofollow">http://pinkstone.co.uk/where-is-the-documents-directory-for-the-ios-8-simulator/</a></p>