I have my app in portrait mode. When video player enters full screen mode, I want to play that video in both landscape and portrait orientation

moviePlayer = [[MPMoviePlayerController alloc]initWithContentURL:url];
    [moviePlayer.view setAutoresizingMask:(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth)];

    [moviePlayer setScalingMode:MPMovieScalingModeFill];


    moviePlayer.view.frame = CGRectMake(0, 0, self.videoPlayerView.frame.size.width, self.videoPlayerView.frame.size.height);
    [self.videoPlayerView addSubview:moviePlayer.view];

and I am playing it on one button. Thanks in Advance


Source: ios

Leave a Reply