我正在尝试使用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];
我该如何解决这个问题?