MPMoviePlayerController覆盖iOS 6 [英] MPMoviePlayerController Overlay iOS 6

查看:112
本文介绍了MPMoviePlayerController覆盖iOS 6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iOS6中有一个带有叠加层的MPMoviePLayerController有问题,在iOS6之前一切正常。

Having an issue with MPMoviePLayerController with an overlay in iOS6, prior to iOS6 things were working fine.

看来我可以在全屏播放电影,之前我有这个代码:

It seems I can play a movie in full screen, before I had this code:

@interface MovieOverlayViewController : UIViewController
{
    UIImageView *skiparrow;
}
@end


@implementation MovieOverlayViewController

-(void) viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

    touchtoskip.frame = CGRectMake( xAdjust,
                                   yAdjust,
                                   touchtoskip.image.size.width / scale, 
                                   touchtoskip.image.size.height / scale);



    [self.view addSubview:touchtoskip];
}

然后:

overlay = [[MovieOverlayViewController alloc] init];

UIWindow *keyWnd = [[UIApplication sharedApplication] keyWindow];
[keyWnd addSubview:overlay.view];

在我的MoviePlayerViewController上,视图显示。并添加了UIViews,但我再也看不到了。

On my MoviePlayerViewController the view DOES appear. And adds the UIViews, but I see NOTHING anymore.

真的卡住了,有什么建议吗?

Really stuck, any suggestions?

推荐答案

我认为部分问题在于您正在获取关键窗口并为其添加子视图,而不是获取窗口视图并向其添加子视图。

I think part of the problem is that you are getting the key window and adding a subview to that, rather than getting the window's view and adding a subview to that.

查看 MoviePlayer 示例,显示如何添加带有子视图的播放器来控制播放。

Have a look at the MoviePlayer sample, which shows how to add a player with subviews to control playback.

这篇关于MPMoviePlayerController覆盖iOS 6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆