将自定义控件添加到iPhone 3.0 SDK中的MoviePlayer [英] Add Custom Controls to MoviePlayer in iPhone 3.0 SDK

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

问题描述

我想将自定义控件添加到mediaPlayer控件视图中,就像这个询问器一样:

I'd like to add custom controls to the mediaPlayer control view much as this asker:

将自定义控件添加到MoviePlayer

但是,上述问题中发布的解决方案在3.0中已贬值.有人知道新SDK可以做到这一点吗?

However, the solution posted in the above question is depreciated in 3.0. Does anyone know of a way to do this with the new SDK?

到目前为止,我已经在moviePlayer视图中添加了overlayView并可以在触摸时显示我自己的控件,但是我似乎无法将触摸传递到moviePlayer视图以使其显示本机控件.

So far I have added an overlayView to the moviePlayer view and can display my own controls on touch, but I can't seem to pass the touch on to the moviePlayer view to get it to display the native controls.

我一直在使用touchesBegan和touchesEnded无济于事.任何帮助表示赞赏.

I've been using touchesBegan and touchesEnded to no avail. Any help is appreciated.

推荐答案

从以下位置找到了我自己的问题的答案:

Found an answer to my own question from: http://blogs.oreilly.com/iphone/2008/11/the-joys-of-vertical-audio.html

即,我正在使用:

id internal;
object_getInstanceVariable( mVideoPlayer, "_internal", (void*)&internal);
id videoViewController;
object_getInstanceVariable(internal, "_videoViewController", (void*)&videoViewController);
id vvController = videoViewController;

然后我可以做:

[[vvController _overlayView] addSubview:controlImage];

它仍然很hacky,但是希望这会对其他人有所帮助...

It's still quite hack-y but hopefully this will help someone else...

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

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