2014-09-11 3 views
5

Dans mon application, je charge des pages Web intégrées avec des photos et des vidéos. Aussi j'utilise les notifications suivantes pour gérer le joueur,Les rappels vidéo UIWebView Embed ne fonctionnent pas dans iOS8?

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(embeddedVideoStarted:) name:@"UIMoviePlayerControllerDidEnterFullscreenNotification" object:nil]; 
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(embeddedVideoEnded:) name:@"UIMoviePlayerControllerWillExitFullscreenNotification" object:nil]; 

Cela fonctionne bien dans iOS 7, mais son iOS8 ne fonctionne pas. Des solutions de contournement? Merci d'avance.

Répondre

4

Ceci est une option, je l'ai trouvé .. Le problème est que ne Will est-il devenu caché ..

[[NSNotificationCenter defaultCenter] addObserver:self 
              selector:@selector(embeddedVideoStarted:) 
               name:UIWindowDidBecomeVisibleNotification 
               object:self.view.window]; 

[[NSNotificationCenter defaultCenter] addObserver:self 
              selector:@selector(embeddedVideoEnded:) 
               name:UIWindowDidBecomeHiddenNotification 
               object:self.view.window]; 

Si, je trouve une solution pour la deuxième notification je posté .. :)

+0

Avez-vous trouvé une solution? DidBecomeHidden est trop tard pour obtenir l'orientation de l'écran en arrière ... – Boaz

+0

vous pouvez obtenir l'orientation de l'arrière .. vous pourriez vouloir jeter un coup d'oeil un [this ->] (http://stackoverflow.com/questions/26611646/ios7-ios8-autoriser-seulement-portrait-dans-vue-contrôleur/26612748 # 26612748) ou [ici ->] (http://stackoverflow.com/questions/26694955/properly-force-or-allow-landscape- mode-pour-youtube-embedded-video-in-ios-8-witho) J'espère que ça aide! – NorthBlast

+0

J'ai implémenté une telle solution, mais le problème est que la propriété supportedInterfaceOrientationsForWindow est appelée avant UIWindowDidBecomeHiddenNotification. Et que l'écran derrière la vidéo est le paysage. J'ai besoin d'invoquer manuellement UIWindowDidBecomeHiddenNotification – Boaz

Questions connexes