I cannot seem to find any documentation on how to process deep link parameters while the channel is running as per the new requirement:
When the channel is already running, direct playback commands will deep link to content in the channel without requiring a channel launch delay by using roInputEvent. To support this, channels must process roInputEvent the same way deep link parameters are passed through the main entry point on launch.
I already have deep linking support on my channel and it works, however, no matter what I do the channel always re-launches when testing deep-linking. I have used both the deep linking test app and curl with the same result. Does anyone know how to properly support and test this?
The former will always (re)launch the channel because it includes a command to launch it directly in the URI. The latter is the way to send input to a roInputEvent. As far as I know the deeplinking test tool only supports the launch commands.
I’ve tried using both the input and the launch commands. The input command causes the channel to relaunch when the mediatype and contentid parameters are present.
I believe relaunching the channel when a deep linking request is received is proper behavior. When the channel relaunches, you’re supposed to read the one or two variables on the request and then if possible immediately start playing the requested content. New firmware may have changed this behavior, and if it did I don’t know how you’d do what they require at the moment.
“sawood6626” wrote:
I’ve tried using both the input and the launch commands. The input command causes the channel to relaunch when the mediatype and contentid parameters are present.
Can you post some snippets of your code that deals with a roInputEvent? I don’t understand why an input event would cause your channel to relaunch unless it has to do with the way it’s structured. If it helps, I can show you the code I added (really only a handful of lines difference) in order to deal with roInputEvents, in comparison to the code that deals with “standard” deep linking. I don’t know how “right” this is, but it does work and the channel doesn’t relaunch when I send a curl command with “input” rather than “launch.”
Sub Main(args as Dynamic)
screen = CreateObject("roSGScreen")
m.scene = screen.CreateScene("HomeScene")
port = CreateObject("roMessagePort")
input = CreateObject("roInput") # THIS LINE IS NEW
screen.SetMessagePort(port)
input.SetMessagePort(port) # THIS LINE IS NEW
screen.Show()
...
if args.ContentID <> invalid and args.MediaType <> invalid
? "[Main] Processing deeplink..."
ProcessDeepLink(args)
end if
while(true)
msg = wait(0, port)
? "msg = " + msg
if type(msg) = "roInputEvent" and msg.isInput() then # THIS BLOCK IS NEW
if msg.GetInfo().MediaType <> invalid and msg.GetInfo().ContentID <> invalid
ProcessDeepLink(msg.GetInfo())
end if
end if
...
end while
...
End Sub
My code is almost identical to that; just has different names. I have successfully captured roInput events without having the channel re-launch. It only re-launches when the input contains the “mediaType” and “contentId” fields.
I ran into this exact same issue as well. I assumed the deep links using roInputEvent wouldn’t cause a relaunch but they do. I ended up testing with different var names (contentId2, mediaType2) as well to make sure my channel could deep link without relaunching.
What hardware and OS are you encountering this problem on?
I just tried to replicate it on five different devices, some running 8.1 and some running 8.2, and I wasn’t able to do so. My channel never relaunches as long as I send the command as an input command rather than as a launch command. I am curious whether it’s a hardware or a software/OS problem, because obviously this is an issue people should know about if they’re struggling to comply with the new requirements and the relaunching is outside of their control somehow…
I’m also encountering it on my Roku Streaming Stick Plus. It’s not in front of me right now, so I’ll post the OS version for that one as soon as I get chance.
“sawood6626” wrote:
I cannot seem to find any documentation on how to process deep link parameters while the channel is running as per the new requirement:
When the channel is already running, direct playback commands will deep link to content in the channel without requiring a channel launch delay by using roInputEvent. To support this, channels must process roInputEvent the same way deep link parameters are passed through the main entry point on launch.
I already have deep linking support on my channel and it works, however, no matter what I do the channel always re-launches when testing deep-linking. I have used both the deep linking test app and curl with the same result. Does anyone know how to properly support and test this?
If you have that set, and you have an roInput monitor active, then sending the input command should cause your channel to receive the roInputEvent, not re-launch your channel. Note that the input command must have mediaType and contentID parameters to be recognized as a deep link event.
It’s not easy but basically a nickname for the movie and a type are passed into the channel app as two strings. Instead of giving your movies long serial numbers just call them by their name in all caps with no spaces like this:
The channel form only allows so many movies in this list even though Roku says it needs way more… I only submit maybe 20-30 or whatever fits in the form’s box. They will use this list to test your channel, but they also have a deep link testing channel you can install to test prior to submitting anything to Roku. I suggest that you fully get it working before sending Roku in circles with long delays that will cause you to pull your hair out.
The trick to deep linking is that in your main.brs script you need to check for the contentID and mediaType variables then store these in some global variables to be examined by your grid script. Normally when my channel is being browsed the focus method updates the title and description of the selected movie/item and displays this on the screen. If deep linking is active then you can display the grid as usual or not, but at some point you need to fire the onclick method as if the user clicked on an item, but use the deep linked contentID. You’ll need to scan your entire content list for a match of the contentID and if found, “click” on that movie. It’s still more nasty than this but this should get you started.