Add Custom Controls to MoviePlayer in iPhone 3.0 SDK

寵の児 提交于 2019-12-22 13:00:20

问题


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.


回答1:


look at this sample project http://developer.apple.com/iphone/library/samplecode/MoviePlayer_iPhone/ it does it in there




回答2:


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...



来源:https://stackoverflow.com/questions/1240524/add-custom-controls-to-movieplayer-in-iphone-3-0-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!