简体   繁体   English

纵向模式下的iPad视频

[英]iPad video in portrait mode

I have made an iPad video in portrait mode ie 768*1024 . 我已经以portrait mode制作了一个iPad video ,即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? 现在,当我将其转换为mp4格式时,转换器会将其转换为1024*768landscape mode 。是否有任何方法可以以纵向模式显示纵向视频,或者是否可以通过任何软件以mp4纵向模式转换纵向视频?

or I would have to make the video again in landscape mode? 还是我必须再次以横向模式制作视频?

I am using MPMoviePlayerController . 我正在使用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. 默认情况下, MPMoviePlayerController不再在横向中运行 ,因此要使其在横向中运行,您需要对视图应用转换。

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 :-) 这是供您参考的信息,“ 在不使用Private API的情况下在MPMoviePlayerController中播放视频,这将被Apple拒绝。 ”祝您好运,编码愉快:-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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