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

roTimeSpan Timer Issue

I have created a timer for a timeout if a user watched for a period of time. I set my logic to 10 seconds for ease of testing, but whether I put 10 seconds or 5 seconds, I noticed that the Message box won't show for 27 Seconds every time. If I set my logic to popup a message after lets say 2 hours, will it be 2 hours or 3x that? Here is a partial in my Function showVideoScreen from videoplayer. Any idea why it does not read my timer.Mark() and begin countdown at the proper time?

' Add Timer		
timer = CreateObject("roTimespan")
timer.Mark()
While True

If timer.TotalSeconds() >= 10 Then
' The user has been idle watching the video for 10 Seconds, prompt the user to see if they're still watching
messageBox = CreateObject("roMessageDialog")
messageBox.SetMessagePort(CreateObject("roMessagePort"))
messageBox.SetTitle("Still Watching TV?")

.
.

Else
' We won't get here unless the user responds, so close the dialog, reset the timer, and continue with the video
messageBox.Close()
timer.Mark()
End If
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.