Your Digital Media Has Never Looked So Good

 
sawood6626
Topic Author
Posts: 9
Joined: Tue Oct 31, 2017 11:44 am

Help on Implementing New Deep Linking Requirements

Mon Nov 05, 2018 12:43 pm

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?
 
User avatar
entrez
Posts: 3
Joined: Fri Sep 28, 2018 3:00 pm
Location: nyc

Re: Help on Implementing New Deep Linking Requirements

Mon Nov 05, 2018 3:54 pm

Are you using the "standard" deep linking command (which includes the command to launch the channel) like this:

curl -d '' '<roku IP>:8060/launch/dev?contentID=<UUID>&mediaType=movie'

Or are you using a curl command formatted for roInput? Like this (as found here):
curl -d '' '<roku IP>:8060/input?my_event=My%20Test&param2=100&param3=200&action=start'

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.
 
sawood6626
Topic Author
Posts: 9
Joined: Tue Oct 31, 2017 11:44 am

Re: Help on Implementing New Deep Linking Requirements

Mon Nov 05, 2018 5:46 pm

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.
 
destruk
Posts: 2600
Joined: Sat Dec 18, 2010 4:58 pm

Re: Help on Implementing New Deep Linking Requirements

Mon Nov 05, 2018 8:25 pm

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.
 
User avatar
entrez
Posts: 3
Joined: Fri Sep 28, 2018 3:00 pm
Location: nyc

Re: Help on Implementing New Deep Linking Requirements

Thu Nov 08, 2018 9:11 am

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
 
sawood6626
Topic Author
Posts: 9
Joined: Tue Oct 31, 2017 11:44 am

Re: Help on Implementing New Deep Linking Requirements

Thu Nov 08, 2018 10:28 am

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.
 
turtlehat
Posts: 3
Joined: Thu Oct 25, 2018 9:05 am

Re: Help on Implementing New Deep Linking Requirements

Thu Nov 08, 2018 11:35 am

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.
 
User avatar
entrez
Posts: 3
Joined: Fri Sep 28, 2018 3:00 pm
Location: nyc

Re: Help on Implementing New Deep Linking Requirements

Mon Nov 12, 2018 1:47 pm

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...
 
sawood6626
Topic Author
Posts: 9
Joined: Tue Oct 31, 2017 11:44 am

Re: Help on Implementing New Deep Linking Requirements

Mon Nov 12, 2018 3:10 pm

4400X - Roku 4
OS - 8.1.0 - build 4131-17

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.
 
User avatar
RokuKC
Posts: 305
Joined: Wed Sep 10, 2014 10:44 am
Location: Roku HQ

Re: Help on Implementing New Deep Linking Requirements

Mon Nov 12, 2018 6:14 pm

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?


Are you setting supports_input_launch=1 in your channel's manifest file?
https://sdkdocs.roku.com/display/sdkdoc ... l+Manifest

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.
 
sawood6626
Topic Author
Posts: 9
Joined: Tue Oct 31, 2017 11:44 am

Re: Help on Implementing New Deep Linking Requirements

Tue Nov 13, 2018 7:20 am

That's the piece I'm missing. Thanks!
 
cocotower
Posts: 19
Joined: Fri Sep 22, 2017 8:26 pm

Re: Help on Implementing New Deep Linking Requirements

Tue Nov 13, 2018 6:56 pm

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:

contentID = "SOMEOLDMOVIE1934"
mediaType = "movie"
contentID = "ANOTHERMOVIE1936"
mediaType = "movie"
etc.

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.
 
destruk
Posts: 2600
Joined: Sat Dec 18, 2010 4:58 pm

Re: Help on Implementing New Deep Linking Requirements

Tue Nov 13, 2018 8:10 pm

Naturally, it goes without saying, if you only have one "media type" then you can simply match on the contentID.

Who is online

Users browsing this forum: muteki and 4 guests