views:

312

answers:

1

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  A: 

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.

h4xxr