iphonevimeomovieplayer

Appliction orientation changes to landscape if I stop a video in landscape


I am working on an application in which I have embedded an iframe on a screen to show the thumbnail of a video from vimeo.com. Every thing is working perfect but when I tap to play the video it invokes iPhone's DEFAULT MOVIE PLAYER and then I rotate my iPhone to landscape and video plays in landscape mode. But if video finishes in landscape mode then the screen (on which I have added the vimeo iframe) also gets rotated in landscape mode. I need to fix it in portrait only but video should play in portrait and landscape both modes. Thanks!


Solution

  • When we play a video in this way then iPhone's in built video player get invoked that is of class "mpinlinevideoviewcontroller". We can't control it's functionality. So I set

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        // Return YES for supported orientations
        return YES;
    }
    

    in the view controller containing the web view and now only this screen of the application supports all orientation and thus my issue got removed (but not resolved).