我想在 uitableviewcell 上播放视频。但点击播放器查看重启视频。我想单击视频播放器视图打开控制菜单并单击 uitableviewcell 重新启动视频。
- (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath{
if (self.videoPlayer && [self.indexPath_k isEqual:indexPath]) {
cell.imageView.userInteractionEnabled = YES;
cell.imageView.image = [cell.imageView.image Resim_Skala:CGSizeMake(150, 100)];
UIView *vieww = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 150, 100)];
self.videoPlayer.view.frame = CGRectMake(0, 0, 150, 100);
self.videoPlayer.view.userInteractionEnabled = YES;
[vieww addSubview:self.videoPlayer.view];
[cell.contentView addSubview:vieww];
}else{
}
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
self.videoPlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
.....
[self.videoPlayer play];
[self.tableview reloadData];
}
截屏: