In my application, I am trying to play a video in both landscape and portrait mode using MPMoviePlayerController. I have written a piece of code for playing video & handling its rotation. My present code is working completely fine in ios 7 but in ios 8 the issue is that on changing the rotation of ipad to landscape, the video still runs in portrait mode in respect to that position. Can anyone suggest me a way so that I can get out of this issue.
My present code is:
NSURL *videoURL = [NSURL fileURLWithPath:urlFromPrevious];
moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:videoURL];
moviePlayerController.scalingMode = MPMovieScalingModeAspectFit;
moviePlayerController.fullscreen=YES;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playbackFinishedCallback:) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayerController];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willExitFullScreen:) name:MPMoviePlayerWillExitFullscreenNotification object:moviePlayerController];
[[moviePlayerController view] setFrame:CGRectMake(x_axe_forImage, y_axe_forImage, width_forImage, height_forImage+44)];
[[self view] addSubview:[moviePlayerController view]];
[moviePlayerController play];