Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/93.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios _在MPMoviePlayerController中播放视频时,ItemFailedToPaytoEnd错误_Ios_Iphone_Video Streaming_Mpmovieplayercontroller - Fatal编程技术网

Ios _在MPMoviePlayerController中播放视频时,ItemFailedToPaytoEnd错误

Ios _在MPMoviePlayerController中播放视频时,ItemFailedToPaytoEnd错误,ios,iphone,video-streaming,mpmovieplayercontroller,Ios,Iphone,Video Streaming,Mpmovieplayercontroller,我试图使用MPMoviePlayerController播放视频,但出现以下错误: _itemFailedToPlayToEnd: { kind = 1; new = 2; old = 0; } 下面是我的代码 NSURL *fileURL = [NSURL URLWithString:_videoUrl]; NSLog(@" fileURL: %@",fileURL); _moviePlayer = [[MPMoviePlayerController alloc]

我试图使用MPMoviePlayerController播放视频,但出现以下错误:

 _itemFailedToPlayToEnd: {
   kind = 1;
   new = 2;
   old = 0;
  }
下面是我的代码

NSURL *fileURL = [NSURL URLWithString:_videoUrl];
NSLog(@" fileURL: %@",fileURL);
_moviePlayer =  [[MPMoviePlayerController alloc] initWithContentURL:fileURL];
_moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;
UIWindow *backgroundWindow = [[UIApplication sharedApplication] keyWindow];
[_moviePlayer.view setFrame:backgroundWindow.frame];
[backgroundWindow addSubview:_moviePlayer.view];
[_moviePlayer prepareToPlay];
[_moviePlayer play];

如何解决此问题?

我也遇到过同样的问题,查看了很多主题,但没有找到有效的解决方案。 但是我发现,url头响应内容类型的问题在于,您的电影url的类型。。
如果您尝试使用另一台服务器的另一个url设置ContentURL,我想这将解决问题。

您要播放的url是什么?支持iOS格式的视频吗?除了Amar所说的,请尝试从iOS Safari浏览器中播放该文件-如果不起作用,则可以确定该格式不受支持。谢谢你,Amar,直到..我在iOS 7中录制视频时遇到此错误是否有其他方法录制iOS 7