ios8 - How do I rotate MPMoviePlayer as the movie is playing in iOS 8 with Swift? -


i'd ask , answer own question, in case others find helpful.

the movieplayer begin play nicely expected using

movieplayer.view.frame = self.view.bounds 

but, when rotated mid-movie, tabbar rotate, not movieplayer. crop portion of movie screen, or wouldn't change fill whole screen expected.

changing rotation of portrait landscape crops mpmovieplayer

in func viewdidload() add notification service:

nsnotificationcenter.defaultcenter() .addobserver(self, selector: "movieorientationchanged", name: uideviceorientationdidchangenotification, object: nil) 

and, here's method (movieplayer class variable of type mpmovieplayercontroller) responds notification:

func movieorientationchanged() {      movieplayer!.view.frame = self.view.bounds  } 

Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -