Skip to content

Instantly share code, notes, and snippets.

@Lewuathe
Created April 10, 2013 14:22
Show Gist options
  • Select an option

  • Save Lewuathe/5355065 to your computer and use it in GitHub Desktop.

Select an option

Save Lewuathe/5355065 to your computer and use it in GitHub Desktop.
Fighting with custom UITableViewCell ref: http://qiita.com/items/47f33f14a359b5c5d8fd
- (id)initWithIndexPath:(NSIndexPath*)indexPath andVideoPlayer:(AVPlayer *)videoPlayer{
self = [super init];
if( self ) {
AVPlayerLayer* layer = (AVPlayerLayer*)playerView.layer;
layer.videoGravity = AVLayerVideoGravityResizeAspect;
layer.player = videoPlayer;
label.text = [NSString stringWithFormat:@"Movie %d",indexPath.row];
dispatch_queue_t q_global = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_queue_t q_main = dispatch_get_main_queue();
dispatch_async(q_global, ^{
dispatch_async(q_main, ^{
[self.contentView addSubview:playerView];
});
});
}
return self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment