我想在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