MPMoviePlayer无法播放视频。我正在运行iOS 7,并在设备和模拟器上遇到相同的错误:
2013-10-02 12:49:18.246 xxxx[688:60b] _itemFailedToPlayToEnd: {
kind = 1;
new = 2;
old = 0;
我尝试从互联网和文件系统播放视频,但没有成功。我的代码非常简单:
self.moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:@"http://stream.qtv.apple.com/events/mar/123pibhargjknawdconwecown/12oihbqeorvfhbpiubqnfv3_650_ref.mov"]];
self.moviePlayer.view.frame = self.view.bounds;
self.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;
[self.view addSubview:self.moviePlayer.view];
[self.moviePlayer prepareToPlay];
列出的URL是一个有效的电影: http://stream.qtv.apple.com/events/mar/123pibhargjknawdconwecown/12oihbqeorvfhbpiubqnfv3_650_ref.mov
我也尝试过使用MPMoviePlayerViewController,但那也没有起作用。