简体   繁体   中英

iPad video in portrait mode

I have made an iPad video in portrait mode ie 768*1024 . Now when I convert it in mp4 format the converter converts it into 1024*768 ie landscape mode .Is there any way to show the portrait video in portrait mode or any software to convert the portrait video in mp4 portrait mode?

or I would have to make the video again in landscape mode?

I am using MPMoviePlayerController .

Thanks in advance.

MPMoviePlayerController no longer works in landscape by default so to make it work in landscape you need to apply a transform to the view.

UIView * playerView = [moviePlayerController view];
[playerView setFrame: CGRectMake(0, 0, 480, 320)];//iPhone

CGAffineTransform landscapeTransform;
landscapeTransform = CGAffineTransformMakeRotation(90*M_PI/180.0f);
landscapeTransform = CGAffineTransformTranslate(landscapeTransform, 80, 80);

[playerView setTransform: landscapeTransform];
In addition, if you want the regular full screen controls, use the following sample.

moviePlayerController.fullscreen = TRUE;
moviePlayerController.controlStyle = MPMovieControlStyleFullscreen;

This is for your information " playing a video with MPMoviePlayerController in Portrait WITHOUT Private API-Will get rejected by Apple ".Good luck and happy coding :-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM