[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeStarted:) name:@"UIMoviePlayerControllerDidEnterFullscreenNotification" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeFinished:) name:@"UIMoviePlayerControllerDidExitFullscreenNotification" object:nil];
UIMoviePlayerControllerDidExitFullscreenNotification NSNotification在iOs 8中不起作用
答案 0 :(得分:5)
我也面临同样的问题,但最后使用UIWindowDidBecomeVisibleNotification
和UIWindowDidBecomeHiddenNotification
结束了嵌入式YouTube视频(假设通过查看您的选择器方法名称)
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(enteredFullScreen:) name:UIWindowDidBecomeVisibleNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(exitedFullScreen:) name:UIWindowDidBecomeHiddenNotification object:nil];
上面是一个补丁工作,(希望这有帮助)
答案 1 :(得分:0)
我使用MPMoviePlayerController
并且工作正常。我想根据您的使用情况,您不需要UIMoviePlayerController
。
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(youTubeFinished)
name:MPMoviePlayerDidExitFullscreenNotification
object:self.player.moviePlayer];