Developers

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
destruk
Streaming Star

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
Tags (1)
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:
Tags (1)
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
Tags (1)
0 Kudos
Community is Being Upgraded!

We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. Read more here.

Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 19th and you may notice reduced functionality. In the meantime, for additional assistance, visit our Support Site.

We're sorry for this disruption — we’re excited to share what’s next!