我已经试过这个,但它不工作,我最近7个小时都在努力,请帮助我。我想将自定义按钮添加到MPMoviePlayer的全屏视图中。MPMoviePlayerController在全屏添加子视图
代码:
moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL];
[self.view addSubview:moviePlayerController.view];
moviePlayerController.fullscreen = YES;
UIStoryboard *mainStoryBoard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:[NSBundle mainBundle]];
CustomControlsViewController *overlay = (CustomControlsViewController*)[mainStoryBoard instantiateViewControllerWithIdentifier:@"Custom Controls"];
[moviePlayerController.view addSubview:overlay.view];
[moviePlayerController play];
我将在“假”全屏上制作自定义控件,thx! – 1337code 2013-02-11 12:17:19
关于你的第一点 - 我阅读它的方式,可以向movieplayer视图添加子视图,但不要修改任何本机提供的视图(例如遍历子视图并更改它们)。 – Grav 2014-01-29 09:09:27
根据文档“您可以在此属性中的视图中添加子视图,您可以安全地将子视图添加到播放器的视图中。如果要显示自定义回放控件或添加其他与你的应用程序“。 https://developer.apple.com/LIBRARY/IOS/documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/index.html#//apple_ref/occ/instp/MPMoviePlayerController/view – SomeGuy 2014-11-17 09:32:52