我想在uitableviewcell上播放视频。但点击播放器查看重新启动视频。我想点击视频播放器视图打开控制菜单,然后单击可用视图重新启动视频。uitableviewcell上的mpmovieplayercontroller视图
- (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];
}
截图:
http://postimage.org/image/hafzjkjix/
2013年12月..提示 - 它是关于文件扩展名(文件形式网络)非常flakey。在我的应用程序中,.MOV有效,.mov很难将iPhone崩溃。离奇。此外,模拟器根本无法工作,它完全没用,只是崩溃。最后在MPMoviePlayerViewController方法的作品中,MPMoviePlayerController是无用的和破碎的。 – Fattie 2013-12-01 20:40:17