问题:

      在视频播放时,现在控制条采用磨砂的效果,会遮罩部分视频

解决思路

1 播放器直接设置不带控制条,在app在 Foreground状态,默认播放器暂停,这样需要在获得Foreground事件,进行设置播放

- (void) viewWillAppear:(BOOL)animated{  

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillEnterForegroundNotification) name:UIApplicationWillEnterForegroundNotification object:nil];  

}  

- (void) appWillEnterForegroundNotification{  

    NSLog(@"trigger event when will enter foreground.");  

}  

-(void) viewDidDisappear:(BOOL)animated{  

    [[NSNotificationCenter defaultCenter] removeObserver:self];      

}  

2 直接侦听播放器准备播放通知,在通知中设置播放器带控制条

  [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:)

                                                     name:MPMoviePlayerReadyForDisplayDidChangeNotification

                                                   object:player];

 

- (void) moviePlayBackDidFinish:(NSNotification*)notification

{

    player.controlStyle =MPMovieControlStyleEmbedded;

    [[NSNotificationCenter defaultCenter]removeObserver:self name:MPMoviePlayerReadyForDisplayDidChangeNotification object:player];

    

}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
  • 2021-11-03
  • 2021-05-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案