objective c - How to receive Notification in UIWebView Player for full screen mode in iOS 8? -


i wanna stuff after video playing in full screen mode in uiwebview. so, want message uiwebview entering in full screen & exit full screen.

in ios 7 getting notification below stuff :

[[nsnotificationcenter defaultcenter] addobserver:self                                          selector:@selector(videoenterfullscreenhere:)                                              name:@"uimovieplayercontrollerdidenterfullscreennotification"                                            object:self.view.window];  [[nsnotificationcenter defaultcenter] addobserver:self                                          selector:@selector(videoexitfullscreenhere:)                                              name:@"uimovieplayercontrollerdidexitfullscreennotification"                                            object:self.view.window]; 

but in ios 8, not working properly.

i did search on web lots of hours. didn't find perfect solution it.

if guys had implemented please me regarding this.

below stuff worked me. hope others!

in appdelegate.m class,

- (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions {     // override point customization after application launch.      [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(windowbecamehidden:) name:uiwindowdidbecomevisiblenotification object:nil];      return yes; } 

and receive this,

- (void)windowbecamehidden:(nsnotification *)notification {      uiwindow *window = notification.object;      if (window != self.window) {         nslog(@"online video on full screen.");     } } 

thank you!


Comments