MPMoviePlayerController Overlay iOS 6

元气小坏坏 提交于 2019-12-07 05:53:41

问题


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];
}

Then:

overlay = [[MovieOverlayViewController alloc] init];

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

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

Really stuck, any suggestions?


回答1:


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.

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



来源:https://stackoverflow.com/questions/12686972/mpmovieplayercontroller-overlay-ios-6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!