UIWebView电影播放器​​被驳回的iOS 6的错误

当我尝试在UIWebView发起video播放(通过YouTube)时,video打开,然后debugging器说:

 [MPAVController] Autoplay: Enabling autoplay [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 0, on player: 1) 

这里有一个类似的问题: 几秒钟后MPMoviePlayerController停止播放

我唯一的问题是,与一个UIWebView ,我不能build立一个MPMoviePlayerController prepareToPlay 。 至less不是我所知道的。 如果任何人都可以帮助解决这个问题,这将是惊人的!

我在ios6中面临同样的问题。原因是在下面的iOS6时,你的YouTubevideo播放。 viewWillDisappear方法没有调用。但是在iOS6中这个方法每次都会调用YouTube的video播放。这可能是一个bug,我现在不知道。

我修正了以下相同的内容。

设置全屏进入和退出通知的通知,以便您可以设置一些标志值以避免执行SOME一段代码。

 // For FullSCreen Entry [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeVideofullScreen:) name:@"UIMoviePlayerControllerDidEnterFullscreenNotification" object:nil]; // For FullSCreen Exit [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeVideoExit:) name:@"UIMoviePlayerControllerDidExitFullscreenNotification" object:nil]; - (void)youTubeVideofullScreen:(id)sender { //Set Flag True. isFullscreen = TRUE; } - (void)youTubeVideoExit:(id)sender { //Set Flag False. isFullscreen = FALSE; } -(void)viewWillDisappear:(BOOL)animated{ //Just Check If Flag is TRUE Then Avoid The Execution of Code which Intrupting the Video Playing. if(!isFullscreen) //here avoid the thing which you want. genrally you were stopping the Video when you will leave the This Video view. [super viewWillDisappear:animated]; } 

我确定这对你有帮助。

我在我们的一个应用程序中遇到了同样的问题。 原来,我们将UIWebView的HTML设置为-(void)viewWillDisappear的空string。 显然这个方法现在在iOS 6中被调用,当从UIWebView显示一个全屏video,所以这可能是你的问题来自何处。