How to get YTPlayer Done button state in ios?

I use YTPlayer to play videos on YouTube. The video plays correctly, but when I click Finish, which method is called?

+4
source share
2 answers
-(void)playerView:(nonnull YTPlayerView *)playerView didChangeToState:(YTPlayerState)state;

This method calls when you click on done, pause, etc.

+1
source
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(closedFullScreen:) name:UIWindowDidBecomeHiddenNotification object:nil];

-(void)closedFullScreen:(NSNotification *)myNotification{
    [self.playView pauseVideo];

    //required stuff here like dismissing your AVFullScreenViewController
}
0
source

All Articles