Я пытаюсь потоковое видео с 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>.