【问题标题】:iPad video in portrait mode纵向模式下的 iPad 视频
【发布时间】:2013-01-25 06:01:18
【问题描述】:

我在portrait mode 中创建了一个iPad video,即768*1024。现在,当我将其转换为mp4 格式时,转换器会将其转换为1024*768,即landscape mode。有没有办法以纵向模式显示纵向视频或任何软件可以将纵向视频转换为mp4 纵向模式?

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

我正在使用MPMoviePlayerController

提前致谢。

【问题讨论】:

  • 您正在创建视频或转换视频?...我没有看到任何一行编码..粘贴编码部分,以便我们了解您正在尝试做什么..您正在使用任何私有 API 吗?

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


【解决方案1】:

MPMoviePlayerController 在默认情况下不再在 landscape 中工作,因此要使其在横向工作,您需要对视图应用变换。

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”。祝你好运,编码愉快:-)

【讨论】:

    猜你喜欢
    • 2020-04-14
    • 2023-04-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-13
    • 2012-11-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多