Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How detect in BrightScript when Screensaver is shown?

How detect in app when Screensaver is shown ?
How detect when screensaver was hidden?
0 Kudos
9 REPLIES 9
EnTerr
Roku Guru

Re: How detect in BrightScript when Screensaver is shown?

describe your use-case in more detail please. E.g. my channel does this and this - and i have (don't have) private screensaver as part of it etc etc
0 Kudos
destruk
Streaming Star

Re: How detect in BrightScript when Screensaver is shown?

Here is a simple use case - we want to track how many users are logged into the channel for months or years at a time without logging out.  We're also interested in market research to find out what percentage of users have disabled the screensaver vs what percentage have it set to 10 minutes or longer without pinging their roku or unnecessarily hitting our servers to collect this information.  If the screensaver is on and the roku channel app displays a dialog box the screensaver doesn't turn off unless the user does something on the remote.  More hard data about screensavers wouldn't be a bad thing would it?
EnTerr
Roku Guru

Re: How detect in BrightScript when Screensaver is shown?

"destruk" wrote:
Here is a simple use case - we want to track how many users are logged into the channel for months or years at a time without logging out.

Isn't there some timer that kicks out of the channel and to Home screen if it has been inactive for couple of hours or some such? That would make the answer 0 users 🙂

 We're also interested in market research to find out what percentage of users have disabled the screensaver vs what percentage have it set to 10 minutes or longer without pinging their roku or unnecessarily hitting our servers to collect this information.  If the screensaver is on and the roku channel app displays a dialog box the screensaver doesn't turn off unless the user does something on the remote.  More hard data about screensavers wouldn't be a bad thing would it?

In a perfect world, ask a Roku rep and they may tell you that. Or, the answer may be "nunya business" - in which case that won't be doable via API either :). But, hmm - have you tried ECP /query/active-app ? It's been documented for almost a year, without a drumroll.
0 Kudos
belltown
Roku Guru

Re: How detect in BrightScript when Screensaver is shown?

ifAppManager.GetScreensaverTimeout() will tell you what the user's screensaver wait time is set to, zero if it's disabled.

ifAppManager.UpdateLastKeyPressTime() can be used to prevent the channel returning to the Home screen (ever), allowing the channel to run for many years continuously.

In Scene Graph applications, I believe the render thread does not run while the screensaver is active, so if you have a way for the render thread to communicate with a Task thread, which will continue running while the screensaver is running, you might be able to determine in your Task whether the screensaver is running or not, by the absence of such communication.
0 Kudos
destruk
Streaming Star

Re: How detect in BrightScript when Screensaver is shown?

Thanks guys.
0 Kudos

Re: How detect in BrightScript when Screensaver is shown?

Are there any events that can be triggered when the screensaver comes on?
0 Kudos
belltown
Roku Guru

Re: How detect in BrightScript when Screensaver is shown?

"Aleksandr_Sam" wrote:
Are there any events that can be triggered when the screensaver comes on?

Only when the screensaver exits. There's an roDeviceInfoEvent generated:

https://sdkdocs.roku.com/display/sdkdoc/ifDeviceInfo#ifDeviceInfo-EnableScreensaverExitedEvent(enabl...
0 Kudos
tutash
Binge Watcher

Re: How detect in BrightScript when Screensaver is shown?

Yeah. There's a way to figure this out. Knowing how long to wait and knowing when to start waiting kinda gives you the answer.
0 Kudos
sharjeelasghar
Reel Rookie

Re: How detect in BrightScript when Screensaver is shown?

These approaches involve low-level system interactions and require appropriate permissions. For cross-platform solutions, consider using third-party libraries or APIs specific to your application's framework.

0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.