将自定义控件添加到MoviePlayer [英] Add Custom Controls to MoviePlayer

查看:97
本文介绍了将自定义控件添加到MoviePlayer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想弄清楚如何将自定义控件添加到iPhone MoviePlayer。
有关我想要做的示例,请参阅下图。

I am trying to figure out how to add a custom control to the iPhone MoviePlayer. For an example of what I am trying to do see the following image.

alt text http://www.maclife.com/files/u53/06_player.jpg

我正在尝试在基本电影控件的右侧和左侧添加类似控件的内容。

I am trying to add something like the controls on the right and left of the basic movie controls.

我在Open SDK中通过向playerview添加子类来完成此操作,但现在在官方SDK和Apple转向MPMoviePlayerController我不知道该怎么做。

I had done this in the Open SDK by adding a subclass to the playerview, but now in the official SDK and Apple moving to MPMoviePlayerController I am not sure how to do it.

同样以我的旧1.x固件方式,我需要捕捉触摸事件并隐藏/自己显示控件。我希望有一种方法可以用标准控件做到这一点,但如果没有,那很好。

Also with my old 1.x firmware way it required me to capture touch events and hide/show the control myself. I am hoping there is a way that would do this with the standard controls, but if not, that is fine.

提前致谢。

推荐答案

我找到了最佳方法!

你可以像平常一样创建你的电影播放器然后执行以下操作:

You create your movie player like normal and then do the following:

id vvController = [theMovie videoViewController];
[[vvController _overlayView] addSubview:mainView];

其中'mainView'是您的自定义叠加层。这样做会使你的自定义叠加层显示和隐藏正常的叠加层,因为它们现在是同一叠层!

Where 'mainView' is your custom overlay. Doing this makes it so your custom overlay will show and hide with the normal overlays as they are now one in the same!

请注意,这仍然是使用标准框架,但它在框架中没有记录。因此它应该是100%appstore安全,但可能在以后的框架中没有Apple的通知而改变。

这篇关于将自定义控件添加到MoviePlayer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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