Search code examples
iphoneiphone-sdk-3.0media-player

Add Custom Controls to MoviePlayer in iPhone 3.0 SDK


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.


Solution

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