"danstl" wrote:
do you have it so you can enter the IP or hostname from the Roku player itself, or is it hardcoded? If you can enter the information from the roku - do the settings stay after a reboot?
Yes, I used a roKeyboardScreen for it, and it saves it to the registry. Here's the code:
'************************************************************
' ** Check the registry for the server URL
' ** Prompt the user to enter the URL or IP if it is not
' ** found and write it to the registry.
'************************************************************
Function checkServerUrl() as Void
serverURL = RegRead("ServerURL")
if (serverURL = invalid) then
print "ServerURL not found in the registry"
serverURL = "video.local"
endif
screen = CreateObject("roKeyboardScreen")
port = CreateObject("roMessagePort")
screen.SetMessagePort(port)
screen.SetTitle("Video Server URL")
screen.SetText(serverURL)
screen.SetDisplayText("Enter Host Name or IP Address")
screen.SetMaxLength(25)
screen.AddButton(1, "finished")
screen.Show()
while true
msg = wait(0, screen.GetMessagePort())
print "message received"
if type(msg) = "roKeyboardScreenEvent"
if msg.isScreenClosed()
return
else if msg.isButtonPressed() then
print "Evt: ";msg.GetMessage();" idx:"; msg.GetIndex()
if msg.GetIndex() = 1
searchText = screen.GetText()
print "search text: "; searchText
RegWrite("ServerURL", searchText)
return
endif
endif
endif
end while
End Function
Right now it always shows the screen -- I haven't added any setup screen to the player yet.