Hello Everyone,
New here to Roku development, I have been tasked with creating a Roku application that will allow users to stream our radio stations audio. So far everything has been moving along great.
One of the requirements is that we display the current artist, song and DJ information while streaming. We have an XML web service I have been able to consume to gather this information. However I have been unsuccessful in setting up some sort of timer to make this call at a certain interval.
So far I have the isolated code below in an attempt to setup some sort of timeout. But when attempting to set the port I receive the following error:
'Dot' Operator attempted with invalid BrightScript Component or interface reference. (runtime error &hec) in ...w5E0T/pkg:/source/SandBox.brs(11)
011: timer.SetPort(msgPort)
sub Main()
SetTheme()
msgPort = CreateObject("roMessagePort")
sysTime = CreateObject("roSystemTime")
timer = CreateObject("roTimer")
timer.SetPort(msgPort)
timeout = sysTime.GetLocalDateTime()
timeout.AddSeconds(10)
timer.SetDateTime(timeout)
timer.Start()
while true
msg = wait(0, msgPort)
if type(msg) = "roTimerEvent " then
print "10 seconds has elapsed"
timeout=sysTime.GetLocalDateTime()
timeout.AddSeconds(10)
timer.SetDateTime(timeout)
timer.Start()
end if
end while
end sub
I have been scouring these boards and the SDK examples and I see this syntax used in many places. It is quite possible I am doing something incorrectly. From everything I have read, and used up until this point. It seems like a typical event loop, could anyone point out what may be wrong? Or point me to any resources you may think could be helpful? Thanks!
Regards,
Jonathan