Rakesh Bhatt
Rakesh Bhatt

Reputation: 4606

UIMoviePlayerControllerDidExitFullscreenNotification NSNotification not working in iOs 8

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

UIMoviePlayerControllerDidExitFullscreenNotification NSNotification not working in iOs 8

Upvotes: 1

Views: 1044

Answers (2)

Jorge
Jorge

Reputation: 1532

I use MPMoviePlayerController and it works fine. I guess that depending what you are using it for, you don't need UIMoviePlayerController.

[[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(youTubeFinished)
                                                 name:MPMoviePlayerDidExitFullscreenNotification
                                               object:self.player.moviePlayer];

Upvotes: 0

Shankar BS
Shankar BS

Reputation: 8402

i am also faced the same problem but finally ended with using UIWindowDidBecomeVisibleNotification and UIWindowDidBecomeHiddenNotification, for embedded youtube videos(assuming by looking at your selector method names)

 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(enteredFullScreen:) name:UIWindowDidBecomeVisibleNotification object:nil];
 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(exitedFullScreen:)  name:UIWindowDidBecomeHiddenNotification object:nil];

above is a patch work around,(hope this helps)

Upvotes: 5

Related Questions