我用拇指(来自json数据)创建了TTThumbsViewController,当用户点击 thumb 时,我的应用必须在新的子视图中打开视频,如下所示:
- (void)thumbsViewController: (TTThumbsViewController*)controller
didSelectPhoto: (id<TTPhoto>)photo
{
NSMutableArray *photoset = [[NSMutableArray alloc] initWithArray:[self.photoSource photos]];
Photo *selected = [photoset objectAtIndex:[photo index]];
NSLog(@"%@", [selected urlLarge]);
NSURL *url = [NSURL URLWithString:[selected urlLarge]];
MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:moviePlayer];
if ([moviePlayer respondsToSelector:@selector(setFullscreen:animated:)]) {
moviePlayer.controlStyle = MPMovieControlStyleDefault;
moviePlayer.shouldAutoplay = YES;
[self.view addSubview:moviePlayer.view];
[moviePlayer setFullscreen:YES animated:YES];
} else {
[moviePlayer play];
}
}
NSLog显示拇指点击但它打开默认的TTPhotoViewController :(我想禁用并仅显示此子视图。
答案 0 :(得分:1)
这有助于我解决我的问题
- (void)thumbsTableViewCell:(TTThumbsTableViewCell*)cell didSelectPhoto:(id<TTPhoto>)photo {
[_delegate thumbsViewController:self didSelectPhoto:photo];
}