Wednesday, October 17, 2012

iOS - Showing/Hiding MPMoviePlayerController Controls

This question seems to be all over stack overflow and iphone dev sdk forums with no real answer....So how does one show and hide the controls of the MPMoviePlayerController programmatically? Here you go...
 - (void)showControls  
 {  
   for(id views in [[player view] subviews]){  
     for(id subViews in [views subviews]){  
       for (id controlView in [subViews subviews]){  
         if ( [controlView isKindOfClass:NSClassFromString(@"MPInlineVideoOverlay")] ) {  
           [controlView setAlpha:1.0];  
           [controlView setHidden:NO];  
         }  
       }  
     }  
   }  
 }  
 - (void)hideControls  
 {  
   for(id views in [[player view] subviews]){  
     for(id subViews in [views subviews]){  
       for (id controlView in [subViews subviews]){  
         if ( [controlView isKindOfClass:NSClassFromString(@"MPInlineVideoOverlay")] ) {  
           [controlView setAlpha:0.0];  
           [controlView setHidden:YES];  
         }  
       }  
     }  
   }  
 }  




2 comments:

  1. Is this method AppStore-safe?

    ReplyDelete
  2. Thanks for giving such an interesting post. You gave some valuable points which are very useful for all readers to understand Xbee quick start. It's a very good source for learning XBee module.

    ReplyDelete