How to enable iPhone auto lock during MPMoviePlayer playback?

喜欢而已 提交于 2020-01-11 05:12:13

问题


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.

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?


回答1:


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!

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.



来源:https://stackoverflow.com/questions/2489270/how-to-enable-iphone-auto-lock-during-mpmovieplayer-playback

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!