Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS - Video not rotating only in iOS7 over iPhone?

What i have Done?

I am playing videos in an extended class of MPMoviePlayerViewController and have implemented orientation functions as follows

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {

    if (toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown){
        return FALSE;
    }
    else{
        return TRUE;
    }
}

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
    [self setControlsPositions:toInterfaceOrientation];
}
-(BOOL)shouldAutorotate
{
    return YES;
}

What issue i am Facing?

The application works fine up till iOS6 on Both iPhone and iPad Almong with iPad (with iOS7) but the video does not rotate over iPhone with iOS7 installed.

What is the reason for such issue and how it can be resolved?

Update

I have found that the video does rotates if setMovieSourceType is set to MPMovieSourceTypeUnknown but does not rotate when set to `MPMovieSourceTypeStreaming

like image 282
Quamber Ali Avatar asked Sep 30 '13 12:09

Quamber Ali


People also ask

Why are my videos not rotating on iPhone?

Swipe up from the bottom edge of your screen to open Contol Center. Tap the Portrait Orientation Lock button to make sure that it's off.

Why is my video screen not rotating?

Turn on Auto rotate. You'll find this setting in the Quick Settings menu. If you see Auto rotate highlighted in blue, then auto rotate is turned on. If you don't see Auto rotate, but there's a Portrait icon instead, auto rotate is disabled.

Why do some apps not rotate on my iPhone?

Some apps don't support rotation, so your screen may not rotate even if Portrait Orientation Lock is turned off.

Why is my iPhone rotating the wrong way?

Go to Settings > General and choose to use the side switch to Lock Rotation. Turn on Rotation Lock to stop your screen changing orientation. If your iPhone, iPad, or iPod touch screen keeps rotating randomly, try toggling Rotation Lock on and off to fix it.


1 Answers

After apple wanted me to give them a sample for the bug reported by me in iOS-7 i found that i wasn't pushing the view Controller rather i was adding the view to window. In such cases other view Controllers do get the orientation events but the MPMoviePlayerViewController subclass didn't so i just presentated the view controller instead of adding the its view and it worked.

like image 195
Quamber Ali Avatar answered Sep 27 '22 17:09

Quamber Ali