Search code examples
deep-linkingrokubrightscript

Can't Implement Deep Linking in Roku Channel


I have made a Roku channel, which is going to search queries and display the results of images.

There is no video in my channel, the purpose is to search for anything and the channel will give images and some feed results. But when uploading to Roku, it fails certification of deep linking, how can I implement deep linking in this channel, how can I play specific videos on specific parameters? My source/main.brs file And when I test by a curl request like this

curl -d '' 'http://192.168.1.114:8060/input?contentId=1234&mediaType=movie'

this will print the statements and comes here to where I am printing inputs just for seeing what's going on, but when I test through this command

curl -d '' 'http://192.168.1.114:8060/launch/dev?contentId=1234&mediaType=movie'

it restarts my channel and does not come to the print statements.

I have also tried this in main.brs when it receives input request from curl command it comes here, and here I am opening the playVideoScreen, but not works enter image description here

My Questions:

  1. How can I play specific videos of my channel from source/main.brs file, when receiving input from an input curl command.?
  2. How can I handle these deep links if my channel does have not any videos, just have search functionality to search images and feed?
  3. What can I do about the launch command, it just restarts my channel, but it does not come to my print statements, it just re-launches my channel, is this behavior ok, I have also tested Roku sample deep linking, and they are also restarting on launch command, can't understand about that? Please Let me know if you know something about that, I am really stuck and can't understand what to do, the channel is working fine, but due to a deep linking requirement it is stuck, please help me.

Thanks in advance


Solution

  • First you need to understand the difference between launch and input commands. launch command is for launching the channel irrespective of channel already running or need to be launched i.e. if the channel is already running, the launch command will relaunch the channel. If channel is not running it will launch the channel. On the contrary, the input is meant to be when the channel is already running. If channel is not running, input command won't do anything. If the channel is running, the input command will send the parameters to the channel, which roInputEvent will handle. Coming to the questions -

    1. TO pass the certification, you really don't need the handle the roInput event, although dummy code is required(which you already have).

    2. Roku platform is meant to be all about videos. Unfortunately, there is no exception for any channel as far as I know. Any channel should play at least one video to pass the certification as automated testing checks the video playback through deep link.

    3. launch command will not come to the prints as this is not roInputEvent. It need to be handled through parameters passing in main() function. You have to write something like this-

    sub main(args as Object)
    
    ' TODO handle the deep linking when channel is launched
       print "args: " args ' you will get the args.contentId and args.mediaType
    
    end sub