如何在ios中获得YTPlayer Done按钮状态?

时间:2015-02-24 12:40:55

标签: ios iphone ios8

我正在使用YTPlayer播放YouTube视频。视频正在播放但是当我点击完成按钮时,哪个方法被调用?

2 个答案:

答案 0 :(得分:1)

-(void)playerView:(nonnull YTPlayerView *)playerView didChangeToState:(YTPlayerState)state;

当您单击“完成”,“暂停等”时,将调用此方法。

答案 1 :(得分:0)

[[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
}