I have four buttons on the springboard screen. I want to highlight the next button after the event relating to button no. 1 is completed. Is this possible? For example, if my button 1 is labeled “Preview” and after the user is done previewing the video, I want my next button - labeled “Purchase” to be highlighted when it goes back to springboard screen.
There’s not a direct way to do that, but you might be able to achieve the same effect with the External Control Protocol by sending a down button press at the appropriate moment.
Can a send a “down” button press from within the main brs file? I doubt it from the looks of this example - http://blog.roku.com/developer/2011/10/ … arameters/
Yes, it is possible to use ECP from within BrightScript. You can find the IP of the box using roDeviceinfo, then make ECP calls using roURLTransfer. There should be very few cases where you would need/want to do so, but for what you’re trying to do, it might be a possible solution.
Awesome, thanks so much!
“RokuChris” wrote:
Yes, it is possible to use ECP from within BrightScript. You can find the IP of the box using roDeviceinfo, then make ECP calls using roURLTransfer. There should be very few cases where you would need/want to do so, but for what you’re trying to do, it might be a possible solution.quantumguy, here’s a snippet from something I’ve been working on that should help get you started:
Function GetRokuLocalIP() As String
deviceInfo = CreateObject("roDeviceInfo")
ipAddresses = deviceInfo.GetIPAddrs()
For Each key In ipAddresses
ipAddress = ipAddresses[key]
If ipAddress <> invalid And ipAddress.Len() > 0 Then
Return ipAddress
End If
Next
Return ""
End Function
ip = GetRokuLocalIP()
xfer = CreateObject("roURLTransfer")
ECPUrl= "http://" + ip + ":8060/keypress/Down"
xfer.SetURL(ECPUrl)
result = xfer.PostFromString("") 'Note:Most commands in the ECP protocol expect an empty POST body.
See the ExternalControlGuide.pdf of the sdk for more info.
I already had got it working. Thanks though! Yes I followed the ECP guide in the SDK documentation.
“quantumguy” wrote:
I already had got it working. Thanks though! Yes I followed the ECP guide in the SDK documentation.
No problem
