UIMoviePlayerControllerDidExitFullscreenNotification NSNotification在iOs 8中不起作用

Rak*_*att 1 iphone nsnotificationcenter ipad ios ios8

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeStarted:) name:@"UIMoviePlayerControllerDidEnterFullscreenNotification" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeFinished:) name:@"UIMoviePlayerControllerDidExitFullscreenNotification" object:nil];
Run Code Online (Sandbox Code Playgroud)

UIMoviePlayerControllerDidExitFullscreenNotification NSNotification在iOs 8中不起作用

Sha*_* BS 5

我也遇到了同样的问题,但最终结束了使用 UIWindowDidBecomeVisibleNotificationUIWindowDidBecomeHiddenNotification,对于嵌入式youtube视频(假设通过查看您的选择器方法名称)

 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(enteredFullScreen:) name:UIWindowDidBecomeVisibleNotification object:nil];
 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(exitedFullScreen:)  name:UIWindowDidBecomeHiddenNotification object:nil];
Run Code Online (Sandbox Code Playgroud)

上面是一个补丁工作,(希望这有帮助)

  • 你节省了我的时间 (2认同)