title: What is the best way to play video in UITableViewCell
body: <p>I'm trying to make auto-play video in <em>UITableViewCell</em> depending on cell position.</p>
  
  <p>I'm using the <em>AVPlayer</em></p>
  
  <p>Here is my code:</p>
  
  <pre><code>    __weak typeof(self)this = self;
  
      NSString* videoPath = @"http://test.com/test.mp4";
      AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:[NSURL URLWithString:videoPath] options:nil];
      NSArray* keys = [NSArray arrayWithObjects:@"playable",nil];
  
      [asset loadValuesAsynchronouslyForKeys:keys completionHandler:^(){
          AVPlayerItem* playerItem = [AVPlayerItem playerItemWithAsset:asset];
          this.avPlayer = [AVPlayer playerWithPlayerItem:playerItem];
          this.avPlayerLayer = [AVPlayerLayer playerLayerWithPlayer:this.avPlayer];
          this.avPlayerLayer.frame = _videoContent.frame;
  
          dispatch_async(dispatch_get_main_queue(),^{
              [this.videoContent.layer addSublayer:this.avPlayerLayer];
              [this.avPlayer play];
          });
      }];
  </code></pre>
  
  <p>But my UITableView is frozen when i scroll the table.
  I think there are many time-consuming work but most biggest thing is</p>
  
  <pre><code>[this.avPlayer play]
  </code></pre>
  
  <p>So my question is that AVPlayer is the best way in this situation?
  And is there any way to improve the performance?</p>