Re: MPMoviePlayerViewController orientation
Re: MPMoviePlayerViewController orientation
- Subject: Re: MPMoviePlayerViewController orientation
- From: Rainer Standke <email@hidden>
- Date: Thu, 21 Oct 2010 11:54:28 -0700
For whatever it's worth I have solved this problem. Or, rather, I have found another way to get the desired result.
In the docs for MPMoviePlayerViewController it says: "... you can incorporate a movie player view controller wherever you would normally use a view controller." This is what I did with the results I complained about.
It turns out that when I instantiate the MPMoviePlayerViewController, but don't push it myself, things behave as expected. I call 'presentMoviePlayerViewControllerAnimated:newMPMoviePlayerViewController on the previous view controller.
There is a quirk worth mentioning, and that is that in the simulator the 'Done' button doesn't get drawn, but it's functionality is there: just click in the upper left to dismiss the entire thing. On the device the button is drawn as expected.
Rainer
On Oct 20, 2010, at 13:36 , Rainer Standke wrote:
> Hello,
>
> I have an iPhone project where I am using an MPMoviePlayerViewController to display a movie. It is initialized with a URL, and the movie does indeed start playing, in portrait orientation.
>
> I want this to happen in landscape orientation, ideally doing autorotations.
>
> In my subclass of MPMoviePlayerViewController I have this method:
>
> - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
> NSLog(@"rotating to: %d", interfaceOrientation);
> NSLog(@"device orient: %d", [[UIDevice currentDevice] orientation]);
> NSLog(@"UI orient: %d", self.interfaceOrientation);
>
> NSLog(@"generatesDeviceOrientationNotifications: %d", [[UIDevice currentDevice] isGeneratingDeviceOrientationNotifications]);
> return YES;
> }
>
> This method does get called when I rotate the device away from portrait, in which it first appears. The UI orientation never changes away from 1 = portrait.
>
> I have also implemented this:
>
> - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
> {
> NSLog(@"will rotate");
> }
>
> This does get called, but the UI rotation never happens.
>
> What can I do to get a) the movie to play in landscape, and b) the UI to autorotate?
>
> Thanks a lot,
>
> Rainer
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden