开发者

Prevent Android from sleeping while the Flashplayer is running

I've written开发者_如何转开发 a videoplayer for Android based on Flash (10.2) which plays videostreams. In some cases (*), the player begins to buffer for quite some time.

Now, while the player is acually playing the stream, Flash (somehow) signals the OS to prevent entering the sleep-mode. But while buffering, this is not the case and the phone will eventually enter sleep mode before the stream has restarted. So the user has to unlock the phone again - not very convenient.

Is there a way to set a signal with Flash/AS3 to prevent the Andoid-phone to go into sleep mode?

(*) mostly over the mobile network when the network access performes a handover between 3G and 2G or vice versa


just use

// no dimming
NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;

in your mxml or as file.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜