Your Digital Media Has Never Looked So Good

 
Aleksandr_Sam
Topic Author
Posts: 4
Joined: Mon Feb 27, 2017 8:27 am

How detect in BrightScript when Screensaver is shown?

Mon Feb 27, 2017 8:41 am

How detect in app when Screensaver is shown ?
How detect when screensaver was hidden?
 
EnTerr
** Valued Community Member **
Posts: 3834
Joined: Sun Jan 02, 2011 2:41 am

Re: How detect in BrightScript when Screensaver is shown?

Tue Feb 28, 2017 2:43 pm

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
 
destruk
Posts: 2720
Joined: Sat Dec 18, 2010 4:58 pm

Re: How detect in BrightScript when Screensaver is shown?

Tue Feb 28, 2017 4:11 pm

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
** Valued Community Member **
Posts: 3834
Joined: Sun Jan 02, 2011 2:41 am

Re: How detect in BrightScript when Screensaver is shown?

Tue Feb 28, 2017 7:07 pm

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.
 
belltown
Posts: 1465
Joined: Thu Dec 09, 2010 1:43 pm
Contact:

Re: How detect in BrightScript when Screensaver is shown?

Tue Feb 28, 2017 9:51 pm

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.
https://github.com/belltown/
 
destruk
Posts: 2720
Joined: Sat Dec 18, 2010 4:58 pm

Re: How detect in BrightScript when Screensaver is shown?

Fri Mar 03, 2017 11:53 am

Thanks guys.
 
Aleksandr_Sam
Topic Author
Posts: 4
Joined: Mon Feb 27, 2017 8:27 am

Re: How detect in BrightScript when Screensaver is shown?

Wed Mar 15, 2017 1:59 am

Are there any events that can be triggered when the screensaver comes on?
 
belltown
Posts: 1465
Joined: Thu Dec 09, 2010 1:43 pm
Contact:

Re: How detect in BrightScript when Screensaver is shown?

Thu Mar 16, 2017 3:13 pm

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(enableasBoolean)
https://github.com/belltown/
 
tutash
Posts: 14
Joined: Tue Sep 20, 2016 4:33 pm

Re: How detect in BrightScript when Screensaver is shown?

Wed Aug 28, 2019 10:45 am

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.

Who is online

Users browsing this forum: No registered users and 4 guests