iPad视频处于纵向模式

时间:2013-01-25 06:01:18

标签: ios objective-c ipad cocos2d-iphone mpmovieplayercontroller

我在iPad videoportrait mode发了768*1024,即mp4。现在,当我以1024*768格式转换它时,转换器将其转换为landscape modeMPMoviePlayerController。有没有办法以纵向模式显示纵向视频或任何软件转换纵向视频mp4肖像模式?

或者我必须以横向模式重新制作视频?

我正在使用{{1}}。

提前致谢。

1 个答案:

答案 0 :(得分:0)

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;

这是为了您的信息“playing a video with MPMoviePlayerController in Portrait WITHOUT Private API-Will get rejected by Apple”。祝您好运和编码愉快: - )