- (voID)vIEwDIDLoad { [super vIEwDIDLoad]; self.player = [[MPMovIEPlayerController alloc] init]; self.player.contentURL = theURL; self.player.vIEw.frame = self.vIEwForMovIE.bounds; self.player.vIEw.autoresizingMask = UIVIEwautoresizingFlexibleWIDth | UIVIEwautoresizingFlexibleHeight; [self.vIEwForMovIE addSubvIEw:player.vIEw]; [self.player play];}
直到使用者将视频全屏,旋转设备和屏幕上的水龙头才能正常工作.状态栏显示在错误的位置,如下面的屏幕截图所示.
我正在使用iPad的模板Tab bar应用程序.我只在上面添加了vIEwDIDLoad,在XIB中添加了视图变量和一个UIVIEw来显示电影播放器.
我究竟做错了什么?
解决方法 是的,我也遇到这个问题.它肯定是MPMovIEPlayerController本身的错误.我在应用程序中解决的解决方法是在退出全屏模式时自行修正状态栏:
- (voID)playerDIDExitFullscreen:(NSNotification *)notification { MPMovIEPlayerController *movIEPlayer = (MPMovIEPlayerController *) notification.object; if (movIEPlayer == self.player) { UIApplication *app = [UIApplication sharedApplication]; if (app.statusbarOrIEntation != self.interfaceOrIEntation) { [app setStatusbarOrIEntation:self.interfaceOrIEntation animated:NO]; } }}
这在全屏模式下不能解决问题,但它之后会修复它.
请注意,该功能需要添加到通知中:
[[NSNotificationCenter defaultCenter] addobserver:self selector:@selector(playerDIDExitFullscreen:) name:MPMovIEPlayerDIDExitFullscreenNotification object:nil];总结
以上是内存溢出为你收集整理的iPad的MPMoviePlayerController全屏怪癖全部内容,希望文章能够帮你解决iPad的MPMoviePlayerController全屏怪癖所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)