如何在录制视频的应用程序中检测纵向锁定(方向锁定)?
我有一个录制视频的应用程序。我一开始只支持横向,但现在我提供纵向和其他方向。我将视频的变换设置为从 UIDevice 检测到的拍摄方向。但是,如果手机上有纵向锁定,即使用户横向握住设备,UIDevice 也会告诉我当前方向是纵向。
如何确定它是否已锁定,以便我可以以正确的方向保存视频?
I have an app which records video. I only supported landscape at first, but now I'm offering portrait and other orientations. I set the transform of the video to the orientation it was filmed in as detected from UIDevice. However, with portrait lock on the phone, UIDevice would tell me the current orientation is portrait even if the user was holding the device in landscape.
How can I determine if it's locked, so I can save the video in the proper orientation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用设备上的加速计来检测方向。
检查此链接以获取更多信息:
检测 iPhone 屏幕方向
Use the accelerometer on the device to detect orientation.
Check this link for more info:
Detect iPhone screen orientation