Add Custom Controls to MoviePlayer in iPhone 3.0 S

2019-05-19 07:02发布

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

Add Custom Controls to MoviePlayer

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?

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.

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

2条回答
劳资没心,怎么记你
2楼-- · 2019-05-19 07:43
来,给爷笑一个
3楼-- · 2019-05-19 07:58

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

Namely, I'm using:

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

Then I can do:

[[vvController _overlayView] addSubview:controlImage];

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

查看更多
登录 后发表回答