Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
280 views
in Technique[技术] by (71.8m points)

iphone - Add Custom Controls to 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

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

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.

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.

Thanks in advance.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I found the BEST way to do this!

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

id vvController = [theMovie videoViewController];
[[vvController _overlayView] addSubview: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!

Please note that this is still using the standard frameworks, but it is undocumented in the frameworks. So it should be 100% appstore safe, but "could" change without notice from Apple in later frameworks.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...