playMaker

Author Topic: "Screen.sleepTimeout" question  (Read 3714 times)

Tkfore21

  • Playmaker Newbie
  • *
  • Posts: 11
"Screen.sleepTimeout" question
« on: November 30, 2013, 10:04:04 PM »
I'm trying to use "Screen.sleepTimeout = SleepTimeout.NeverSleep;" as a way to keep my mobile device from turning off a sound file. 
After so many minutes the phone will go to sleep if no one taps on the screen.  I have used "Add Script" to my FSM for starting the audio, and created a JS file for handling the about line.
I also have an "Back" button which kills the audio player, and has another script that it starts that contains, "Screen.sleepTimeout = SleepTimeout.SystemSetting;".

The problem I seem to be having is that the second script doesn't seem to be called as the menu and back buttons on my Android phone stay lit up, when they should dim in a second or two.

Does anyone know of another way of trying to get an audio file to play if the screen goes dim and turns off?  The file is 13 minutes in length, so it would suck to make someone keep tapping the screen to keep it playing.

Thanks in advance.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: "Screen.sleepTimeout" question
« Reply #1 on: December 02, 2013, 02:14:21 AM »
Hi,

 If I am not mistaken,  that's something to do with the scope of your application, being able to play a sound if your application is in the background is something to define in your app meta data. I am sure actually that Unity published apps have this ability to begin with.

bye,

 Jean