I want to show movie player controls when the movie is finished, so I add observer to NSNotificationCenter :
- (void)movieFinishedCallback:(NSNotification*)aNotification
{
// Obtain the reason why the movie playback finished
NSNumber *finishReason = [[aNotification userInfo] objectForKey:MPMoviePlayerPlaybackDidFinishReasonUserInfoKey];
if ([finishReason intValue] == 0)
{
[self showControls];
}
// Handle other reasons
}
- (void)showControls
{
for(id views in [[[self.playerVC moviePlayer] view] subviews]){
for(id subViews in [views subviews]){
for (id controlView in [subViews subviews]){
[controlView setAlpha:1.0];
[controlView setHidden:NO];
}
}
}
}
till now every thing is working well and the controls were appeared, but when I tap on the screen in order to hide them, the controls disappeared and appeared again quickly (something like flash), then I need to tap again on the view to hide the controls ..
anybody knows why I got this issue ? or has another idea to show the controls when the video is finished ?