Iphone 电影结束时在电影播放器中显示控件
我想在电影结束时显示电影播放器控件,因此我将observer添加到NSNotificationCenter:Iphone 电影结束时在电影播放器中显示控件,iphone,ios,video,mpmovieplayercontroller,movieplayer,Iphone,Ios,Video,Mpmovieplayercontroller,Movieplayer,我想在电影结束时显示电影播放器控件,因此我将observer添加到NSNotificationCenter: - (void)movieFinishedCallback:(NSNotification*)aNotification { // Obtain the reason why the movie playback finished NSNumber *finishReason = [[aNotification userInfo] objectForKey:MPMovie
- (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];
}
}
}
}
到目前为止,一切正常,控件都出现了,但当我点击屏幕以隐藏它们时,控件消失并很快再次出现(类似于flash),然后我需要再次点击视图以隐藏控件
有人知道我为什么会有这个问题吗?或者在视频结束时有没有其他方法显示控件 首先调试并打印MPMoviePlayerView的子视图,写下子视图并找到控件视图的名称 这是我在应用程序中进行的调试
打印子视图的说明:
controlView的打印说明:
打印子视图的说明:
打印视图说明: