PaulFairless
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2013
04:34 AM
Channel Linking
Hi,
I'm developing a Roku channel, and one of the required features is to launch another channel when a user presses a key - from an advert for example. I know how to capture the key press but I don't know how to launch a 3rd party channel. Using the Roku External Control Protocol I can see how it's possible externally. Is it possible to issue these commands from within a channel?
I have seen an example in the Roku Newscaster channel so hope it is possible
Any help is most appreciated
Paul
I'm developing a Roku channel, and one of the required features is to launch another channel when a user presses a key - from an advert for example. I know how to capture the key press but I don't know how to launch a 3rd party channel. Using the Roku External Control Protocol I can see how it's possible externally. Is it possible to issue these commands from within a channel?
I have seen an example in the Roku Newscaster channel so hope it is possible
Any help is most appreciated
Paul
1 REPLY 1

RokuJoel
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2013
11:30 AM
Re: Channel Linking
You just need the ID of the channel to launch. However, the channel must be published (double check though, this may have changed) before you can actually test this, so test with the id of a published channel and then put in the correct id before publishing.
Here is an example:
- Joel
Here is an example:
Function launch(id as string, seconds=5 as Integer) as String
val=""
timeout% = 1000 * seconds
xfer=createobject("roURLTransfer")
str = ""
xfer.seturl("http://"+getip()+":8060/launch/11?contentID="+id)
?xfer.geturl()
port=createobject("romessageport")
xfer.setport(port)
if (xfer.AsyncPostFromString(val))
event = wait(timeout%, port)
if type(event) = "roUrlEvent"
print "1"
str = event.GetString()
elseif event = invalid
print "2"
?"AsyncPostFromString timeout"
xfer.asynccancel()
else
print "3"
?"AsyncPostFromString unknown event"
endif
endif
?
return str
End Function
function getip() as string
di=createobject("rodeviceinfo")
temp=di.getipaddrs()
temp.reset()
while true
aakey=temp.next()
if not temp=invalid then
return temp[aakey]
end if
end while
end function
- Joel