我想在用户在tableView中按下一行时流一些视频。我使用的是iOS 4.2,当我按下一行时,我听到了声音,但是tableview并没有推开,你看不到视频?我相信这是一个巨大的新手错误,但是...我是一个新手!提前致谢!!!使用MPMoviePlayerController并获取声音,但没有视频
-(void)tableView: (UITableView *)tableView didSelectRowAtIndexPath: (NSIndexPath *)indexPath {
NSString *video;
NSString *url;
NSUInteger row = [indexPath row];
video = [self.videoTitles objectAtIndex:row];
if ([video isEqualToString:@"Shimmy"]) {
url = @"http://www.andalee.com/iPhoneVideos/mov.MOV";
MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc]
initWithContentURL:[NSURL URLWithString:url]];
[moviePlayer play];
} else if ([video isEqualToString:@"Camel"]) {
url = @"http://www.andalee.com/iPhoneVideos/mov.MOV";
MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc]
initWithContentURL:[NSURL URLWithString:url]];
[[self view] addSubview:[moviePlayer view]];
[moviePlayer play];
}
[video release];
[url release];
}