开发者

How to enable iPhone auto lock during MPMoviePlayer playback?

开发者 https://www.devze.com 2022-12-24 11:09 出处:网络
When I play a video with MPMoviePlayerController in my app my iPhone does not auto lock (teste开发者_开发百科d OS 3.0 & 3.1.2). However, the application.idleTimerDisabled = NO, so this setting is

When I play a video with MPMoviePlayerController in my app my iPhone does not auto lock (teste开发者_开发百科d 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消