我有一个通过MPMoviePlayerViewController播放视频文件的项目, 那个过程我完成了。在MPMoviePlayerViewController中,我如何添加像conrols这样的按钮。
答案 0 :(得分:0)
MPMoviePlayerViewController就像任何其他视图控制器一样。您应该能够设置自己的自定义视图,然后将按钮连接到MPMoviePlayerViewController中包含的moviePlayer
答案 1 :(得分:0)
是否要创建MPMovieViewController的自定义,以下代码用于创建自定义的Moviecontroller ..
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
MainScreenVCtr *tempVariable=[[MainScreenVCtr alloc] initWithNibName:(UI_USER_INTERFACE_IDIOM())?@"MainScreeniPad":@"MainScreenVCtr" bundle:nil];
self.nvCtr=[[UINavigationController alloc] initWithRootViewController:tempVariable];
self.nvCtr.view.frame=CGRectMake(0, 20, self.window.frame.size.width, self.window.frame.size.height-20);
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:nil];
[self.window addSubview:self.nvCtr.view];
self.vCtr=[[CustomControllsVCtr alloc] initWithNibName:(UI_USER_INTERFACE_IDIOM())?@"CustomControllsiPad":@"CustomControllsVCtr" bundle:nil];
[self.window makeKeyAndVisible];
return YES;
}
And refer the reference link and Download the source code and implementation tutorail given here.
希望本教程可以帮助您创建自定义的MPViewcontroller。
快乐编码