Hello,
I struggled with this for a while and finally figured out a solution, so I'm posting it here for anyone who might find it useful. It's all in how GetSupportedInterfaceOrientations
gets implemented in your AppDelegate. It's quite simple really, here's the code that I'm using:
public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations (UIApplication application, UIWindow forWindow)
{
if (forWindow != null) {
if (forWindow.RootViewController.PresentedViewController is MediaPlayer.MPMoviePlayerViewController &&
!forWindow.RootViewController.PresentedViewController.IsBeingDismissed)
return UIInterfaceOrientationMask.All;
}
return UIInterfaceOrientationMask.Portrait;
}
And you display the video player as follows from any of your Forms pages:
#if __IOS__
var player = new MediaPlayer.MPMoviePlayerViewController (Foundation.NSUrl.FromString (url));
UIKit.UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController(player, true, null);
#endif