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: 
JasonM
Visitor

Time out Period

I have a private channel but have an issue with my customers. When I disconnect a customer's account they are still able to view the content on their Roku box unless they exit my channel to Roku's main menu. They can remain in my channel indefinitely thereby watching my content continuously unless they have drop in their internet or interruption in their power supply to their Roku box. My channel developers are having difficulty iwith the following:

1) Adjusting the settings to automatically force the user off the channel after an inactive period of time

2)To refresh the available content list during a live connection to the roku box after being logged in.

Look forward to your help guys
0 Kudos
2 REPLIES 2
RokuJoel
Binge Watcher

Re: Time out Period

So you need to first modify any loop that your users are likely to leave the channel in when not watching so that instead of waiting indefinitely, msg=wait(0,port) it waits just short period, like msg=wait(100,port).

Then you need to set a timer so that your channel checks if it is authorized, every 15 minutes or so, you would create and set the timer before the loop:

timer=createobject("rotimespan")
timer.mark()


then within the loop, when the timer reaches 15 minutes,you check if the channel is authorized, the same way you check when the channel starts:


timer=createobject("rotimespan")
timer.mark()
while true
msg=wait(100,port)
if timer.totalseconds() > 900 then
test=checkauthorization()
timer.mark()
if not test then
?"not authorized, exiting"
end
end if
end if


Depending on what the output of your authorization test is, you may need to modify this a bit, for example, if the returned value is a number and not a boolean true/false.

- Joel
0 Kudos
JasonM
Visitor

Re: Time out Period

Joel,

Thanks alot buddy for the timely and efficient response. I just sent the info to my team already. Will keep you posted.

- Jason
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.