【发布时间】:2012-03-23 19:41:01
【问题描述】:
当用户在我的表格视图中选择一行时,我试图从 youtube 流式传输视频, 代码如下:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *videoURLString = [self.listaVideos objectAtIndex:[indexPath row]];
NSURL *videoURL = [NSURL URLWithString:videoURLString];
self.theMovie = [[MPMoviePlayerViewController alloc] initWithContentURL:videoURL];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:[self.theMovie moviePlayer]];
[self.view addSubview:self.theMovie.view];
[self.theMovie setWantsFullScreenLayout:NO];
[self presentMoviePlayerViewControllerAnimated:theMovie];
[[self.theMovie moviePlayer] play];
}
-(void)moviePlayBackDidFinish:(NSNotification*)notification
{
NSLog(@"ENded");
}
还有错误:Unbalanced calls to begin/end appearance transitions for <MPMoviePlayerViewController: 0x7a256a0>.
【问题讨论】:
标签: iphone video-streaming iostream