gpt4 book ai didi

iphone - 强制 MPMoviePlayerController 以横向模式播放视频

转载 作者:搜寻专家 更新时间:2023-10-30 19:57:02 26 4
gpt4 key购买 nike

我有一个只有纵向模式的应用程序,但是当用户播放视频时,我希望它以全屏横向模式播放(视频播放器在纵向模式下看起来不太好)。我是这样玩的:

[self.view addSubview:myMoviePlayer.view];
[self.myMoviePlayer setFullscreen:YES animated:YES];
[self.myMoviePlayer play];

完成此任务的最佳方法是什么?

最佳答案

阅读这篇文章:

http://iosdevelopertips.com/video/getting-mpmovieplayercontroller-to-cooperate-with-ios4-3-2-ipad-and-earlier-versions-of-iphone-sdk.html

主要思想是:

[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];

[[self view] setBounds:CGRectMake(0, 0, 480, 320)];
[[self view] setCenter:CGPointMake(160, 240)];
[[self view] setTransform:CGAffineTransformMakeRotation(M_PI / 2)];

关于iphone - 强制 MPMoviePlayerController 以横向模式播放视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4740732/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com