Playing video in custom size screen - view in iPhone

前端 未结 5 525
死守一世寂寞
死守一世寂寞 2020-12-18 13:24

Suppose user taps on a button and video begins to play. Now when video plays, it always in full screen mode.

Video should be played in a portrait mode (but normally

5条回答
  •  孤城傲影
    2020-12-18 13:47

    Try this out. I found something new.

    @interface MPMoviePlayerController (extend)
    -(void)setOrientation:(int)orientation animated:(BOOL)value;
    @end
    
    moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:movieUR];
    [moviePlayer setOrientation:UIDeviceOrientationPortrait animated:NO];
    if (moviePlayer)
    {
        [self.moviePlayer play];
    }
    

提交回复
热议问题