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: 
destruk
Binge Watcher

Control roku with a different roku

I wanted to see if it was possible. 🙂
Just don't press Home, as that will exit the source roku application. Instant Replay is mapped to the target roku for Home


Sub Main()
ipaddr="192.168.1.120" 'target ip address of target roku
canvas=CreateObject("roImageCanvas") 'create a screen
canvas.SetLayer(0, {Color:"#FF000000",CompositionMode:"Source"})
canvas.Show() 'show the screen
port=CreateObject("roMessagePort")
canvas.SetMessagePort(port)
Home="http://"+ipaddr+":8060/keypress/Home"
Rev="http://"+ipaddr+":8060/keypress/Rev"
Fwd="http://"+ipaddr+":8060/keypress/Fwd"
Play="http://"+ipaddr+":8060/keypress/Play"
Select="http://"+ipaddr+":8060/keypress/Select"
Left="http://"+ipaddr+":8060/keypress/Left"
Right="http://"+ipaddr+":8060/keypress/Right"
Down="http://"+ipaddr+":8060/keypress/Down"
Up="http://"+ipaddr+":8060/keypress/Up"
Back="http://"+ipaddr+":8060/keypress/Back"
Info="http://"+ipaddr+":8060/keypress/Info"
currenturl=""

xfer=CreateObject("roUrlTransfer")

checking:
msg=port.GetMessage()
If type(msg)="roImageCanvasEvent"
If msg.isRemoteKeyPressed()
index=msg.GetIndex()
print index
If index=0
currenturl=Back
xfer.SetUrl(currenturl)
xfer.PostFromString("")
ElseIf index=2
currenturl=Up
xfer.SetUrl(currenturl)
xfer.PostFromString("")
ElseIf index=3
currenturl=Down
xfer.SetUrl(currenturl)
xfer.PostFromString("")
ElseIf index=4
currenturl=Left
xfer.SetUrl(currenturl)
xfer.PostFromString("")
ElseIf index=5
currenturl=Right
xfer.SetUrl(currenturl)
xfer.PostFromString("")
ElseIf index=6
currenturl=Select
xfer.SetUrl(currenturl)
xfer.PostFromString("")
ElseIf index=7
currenturl=Home 'used as pressing home on source roku box will exit this channel instead of the target channel
xfer.SetUrl(currenturl)
xfer.PostFromString("")
ElseIf index=8
currenturl=Rev
xfer.SetUrl(currenturl)
xfer.PostFromString("")
ElseIf index=9
currenturl=Fwd
xfer.SetUrl(currenturl)
xfer.PostFromString("")
ElseIf index=10
currenturl=Info
xfer.SetUrl(currenturl)
xfer.PostFromString("")
ElseIf index=13
currenturl=Play
xfer.SetUrl(currenturl)
xfer.PostFromString("")
End If
End If
End If
goto checking
End Sub
0 Kudos
2 REPLIES 2
GPF
Visitor

Re: Control roku with a different roku

Haha, that is great, except for my 6 year old figured it was me messing with her Netflix watching downstairs :twisted:
0 Kudos
gonzotek
Visitor

Re: Control roku with a different roku

"destruk" wrote:
I wanted to see if it was possible. 🙂
Just don't press Home, as that will exit the source roku application. Instant Replay is mapped to the target roku for Home


Sub Main()
ipaddr="192.168.1.120" 'target ip address of target roku
canvas=CreateObject("roImageCanvas") 'create a screen
canvas.SetLayer(0, {Color:"#FF000000",CompositionMode:"Source"})
canvas.Show() 'show the screen
port=CreateObject("roMessagePort")
canvas.SetMessagePort(port)
Home="http://"+ipaddr+":8060/keypress/Home"
Rev="http://"+ipaddr+":8060/keypress/Rev"
Fwd="http://"+ipaddr+":8060/keypress/Fwd"
Play="http://"+ipaddr+":8060/keypress/Play"
Select="http://"+ipaddr+":8060/keypress/Select"
Left="http://"+ipaddr+":8060/keypress/Left"
Right="http://"+ipaddr+":8060/keypress/Right"
Down="http://"+ipaddr+":8060/keypress/Down"
Up="http://"+ipaddr+":8060/keypress/Up"
Back="http://"+ipaddr+":8060/keypress/Back"
Info="http://"+ipaddr+":8060/keypress/Info"
currenturl=""

xfer=CreateObject("roUrlTransfer")

checking:
msg=port.GetMessage()
If type(msg)="roImageCanvasEvent"
If msg.isRemoteKeyPressed()
index=msg.GetIndex()
print index
If index=0
currenturl=Back
xfer.SetUrl(currenturl)
xfer.PostFromString("")
ElseIf index=2
currenturl=Up
xfer.SetUrl(currenturl)
xfer.PostFromString("")
ElseIf index=3
currenturl=Down
xfer.SetUrl(currenturl)
xfer.PostFromString("")
ElseIf index=4
currenturl=Left
xfer.SetUrl(currenturl)
xfer.PostFromString("")
ElseIf index=5
currenturl=Right
xfer.SetUrl(currenturl)
xfer.PostFromString("")
ElseIf index=6
currenturl=Select
xfer.SetUrl(currenturl)
xfer.PostFromString("")
ElseIf index=7
currenturl=Home 'used as pressing home on source roku box will exit this channel instead of the target channel
xfer.SetUrl(currenturl)
xfer.PostFromString("")
ElseIf index=8
currenturl=Rev
xfer.SetUrl(currenturl)
xfer.PostFromString("")
ElseIf index=9
currenturl=Fwd
xfer.SetUrl(currenturl)
xfer.PostFromString("")
ElseIf index=10
currenturl=Info
xfer.SetUrl(currenturl)
xfer.PostFromString("")
ElseIf index=13
currenturl=Play
xfer.SetUrl(currenturl)
xfer.PostFromString("")
End If
End If
End If
goto checking
End Sub

Smiley LOL



In testing Remoku one of the sillier things I did was load it on the Logitech Revue/Google TV version of Chrome, so Remoku was displayed on a different input of the same sixty-inch screen as the Roku. Totally pointless for actual use of course, but I wanted to see that everything worked (it did) and it made me laugh to see it blown up so large.
Remoku.tv - A free web app for Roku Remote Control!
Want to control your Roku from nearly any phone, computer or tablet? Get started at http://help.remoku.tv
by Apps4TV - Applications for television and beyond: http://www.apps4tv.com
0 Kudos