我正试着用这个指南播放视频:Application
所以我有:
//movieplayer initialization
NSURL *url = [NSURL URLWithString:
@"http://www.youtube.com/watch?v=CS-6gJkNAo4"];
self.moviePlayer = [[MPMoviePlayerController alloc]
initWithContentURL:url];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:self.moviePlayer];
self.moviePlayer.controlStyle = MPMovieControlStyleDefault;
self.moviePlayer.shouldAutoplay = YES;
[self.movieView addSubview:self.moviePlayer.view];
[self.moviePlayer setFullscreen:YES animated:YES];将播放机加载到某个视图的位置。我什么也没看到,我只收到一条错误消息:
_itemFailedToPlayToEnd: {
kind = 1;
new = 2;
old = 0;
}发布于 2014-03-17 09:51:01
MPMoviePlayerController不能播放Youtube视频。您必须粘贴直接链接到文件,以这样的方式播放视频。
https://stackoverflow.com/questions/22450827
复制相似问题