开发者

How to enable iPhone auto lock during MPMoviePlayer playback?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜