-1
我有一個使用UITableView的時間軸來顯示視頻縮略圖。用戶可以點擊一個視頻縮略圖,並打開全屏視頻並播放。當用戶點擊完成按鈕時,用戶返回到時間線。現在,視頻縮略圖消失了,用戶可以看到他們正在觀看的視頻以及他們離開的位置。我希望在用戶點擊完成按鈕的位置將它們帶回到時間軸,並在播放全屏視頻之前顯示視頻縮略圖圖像。下面是一些代碼:用戶點擊完成退出全屏後重新顯示視頻縮略圖 - 目標C
cell.imageView.image = [UIImage imageNamed:@"PlaceholderPhoto"];
if (object) {
//The below line displays the users video thumbnail on the timeline.
//The following 2 lines is what fills the display cell that shows the photo.
cell.imageView.clipsToBounds = YES;
cell.imageView.contentMode = UIViewContentModeScaleAspectFill;
//The below line is what displays the video thumbnail on the home timeline.
cell.imageView.file = [object objectForKey:@"videoThumbnail"];
[cell.imageView loadInBackground];
PFFile *video =[object objectForKey:@"file"];
[video getDataInBackgroundWithBlock:^(NSData *data, NSError *error) {
if (!error) {
NSString *string = [NSString stringWithFormat:@"cell%li.m4v", (long)cell.mediaItemButton.tag];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *appFile = [documentsDirectory stringByAppendingPathComponent:string];
[data writeToFile:appFile atomically:YES];
NSURL *movieUrl = [NSURL fileURLWithPath:appFile];
//The below line is what displays the full size movie and plays it on the home timeline.
[cell.movie setContentURL:movieUrl];
}
}];
}
return cell;