如何在MPMoviePlayer播放期间启用iPhone自动锁定? [英] How to enable iPhone auto lock during MPMoviePlayer playback?

查看:107
本文介绍了如何在MPMoviePlayer播放期间启用iPhone自动锁定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在我的应用程序中使用MPMoviePlayerController播放视频时,我的iPhone不会自动锁定(测试OS 3.0& 3.1.2)。但是,application.idleTimerDisabled = NO,因此此设置不受MPMoviePlayerController的影响。

When I play a video with MPMoviePlayerController in my app my iPhone does not auto lock (tested OS 3.0 & 3.1.2). However, the application.idleTimerDisabled = NO, so this setting is not affected by MPMoviePlayerController.

如何让我的iPhone正常睡眠(例如,3分钟屏幕变暗后,当我的应用程序正在运行并播放视频时,它会变暗?

How can I get my iPhone to sleep normally (e.g. after 3 min screen dims, then goes dark) when my app is running and playing a video?

推荐答案

这是MPMoviePlayerController的一项功能;大多数人不希望他们的屏幕在三分钟的视频后关闭,如果他们还没有触摸它!

That is a feature of MPMoviePlayerController; most people don't want their screens turning off after three minutes of video if they haven't touched it!

我想你可以实现一个自定义控件覆盖在上面你的电影(在默认的Apple电影播放器​​iPhone演示应用中解释),每次按下一个隐形按钮,重置一个计时器。如果计时器触发(例如3分钟后),您可以暂停/停止视频。

I guess you could implement a custom controls overlay on top of your movie (explained in the default Apple movie player iPhone demo app) that consists of one invisible button that each time it is pressed resets a timer. If the timer triggers (eg after 3 minutes) you could pause/stop the video.

这篇关于如何在MPMoviePlayer播放期间启用iPhone自动锁定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆