MPMoviePlayerController不会全屏播放电影

前端之家收集整理的这篇文章主要介绍了MPMoviePlayerController不会全屏播放电影前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我的iPad应用程序上有一个MPMoviePlayerController,当它的帧是常规的(不是全屏)时效果很好.

当我点击全屏按钮时,播放器全屏显示,但电影停止.我永远看到标题为“正在加载…”,黑色背景,并禁用标准控件(后退,播放和下一个).

我为玩家声明了一个实例变量:

  1. MPMoviePlayerController *player;

在我的实施中:

  1. MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:videoUrl];
  2.  
  3. player.shouldAutoplay = NO;
  4. player.movieSourceType = MPMovieSourceTypeFile;
  5. player.controlStyle = MPMovieControlStyleEmbedded;
  6. player.allowsAirPlay = YES;
  7.  
  8. player.view.frame = CGRectMake(xPos,yPos,width,height);
  9.  
  10. [self.view addSubview:player.view];
  11.  
  12. [player prepareToPlay];

你有什么主意吗?我正在使用iOS 6 SDK,我正在测试iPad 6.0模拟器上的应用程序和带有iOS 6 beta(最新)的真正iPad2.

解决方法

我的天啊!!!

我写…

  1. [player stop];

在viewWillDisappear !!!我怎么会这么傻?!今晚没有蛋糕……

猜你在找的iOS相关文章