Sie können AVPlayer Verwenden Sie einfach mit diesem Code, wird es mit funktionieren
//Change the return value how many video screen you want
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 5;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
myCell *cell = [myTable dequeueReusableCellWithIdentifier:@"cell"];
//You can set multiple video path using array
NSString *filePath = [[NSBundle mainBundle] pathForResource:@“myVideo” ofType:@"MOV"];
NSURL *url = [NSURL fileURLWithPath:filePath];
cell.videoPlayer = [[AVPlayer alloc]init];
cell.avLayer = [[AVPlayerLayer alloc]init];
NSLog(@"url %@",url);
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul);
dispatch_async(queue, ^{
dispatch_sync(dispatch_get_main_queue(), ^{
cell.videoPlayer = [AVPlayer playerWithURL:url];
// create a player view controller
AVPlayerViewController *controller = [[AVPlayerViewController alloc]init];
controller.player = cell.videoPlayer;
[cell.videoPlayer play];
// show the view controller
[self addChildViewController:controller];
[cell.myView addSubview:controller.view];
controller.view.frame = cell.myView.frame;
});
});
return cell;
}
Sie bitte Ihren Code was Sie implementiert haben? –