Hi all! I have a view and a MPMoviePlayerViewController.. the iPad is oriented in landscape left mode, but when I play the video, the video is good to see in portrait mode... is there a way to force movieplayer to rotate in landscape mode? thanks in advance
+2
A:
you can force a MPMoviePlayerViewcontroller to work in landscapce mode by
[player setOrientation:UIDeviceOrientationPortrait animated:NO];
You can read my blog entry for sample code http://www.makebetterthings.com/blogs/iphone/play-video-on-iphone-and-ipad/
Saurabh
2010-06-08 10:07:29
thanks Saurabh! I read yesterday your blog ( I poosted also ) but the line where shows this thing I skipped, I don't know how!!!!!Thanks, I'll try soon!
ghiboz
2010-06-08 10:21:30
Thanks for reading my blog!:)
Saurabh
2010-06-08 10:45:50
sorry, but the MPMMoviePlayerViewController doesn't have setOrientation method...https://developer.apple.com/iphone/prerelease/library/documentation/MediaPlayer/Reference/MPMoviePlayerViewController_class/Reference/Reference.html
ghiboz
2010-06-08 20:11:01
sorry, i read into your blog that setOrientation is not ready for iPad....
ghiboz
2010-06-08 20:14:27
+3
A:
@interface MyMovieViewController : MPMoviePlayerViewController
@end
@implementation MyMovieViewController
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
return UIInterfaceOrientationIsLandscape(toInterfaceOrientation);
}
@end
Then just instantiate MyMovieViewController instead of MPMoviePlayerViewController.
tc.
2010-06-21 17:00:35