我在iPad video
中portrait mode
发了768*1024
,即mp4
。现在,当我以1024*768
格式转换它时,转换器将其转换为landscape mode
即MPMoviePlayerController
。有没有办法以纵向模式显示纵向视频或任何软件转换纵向视频mp4肖像模式?
或者我必须以横向模式重新制作视频?
我正在使用{{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”。祝您好运和编码愉快: - )