Deep Linking in Roku

02 / Mar / 2017 by Simranjit Kour 3 comments

Deep linking is used for launching the public channel, universal search and directly open to a particular video in a public channel.

According to new Roku development guidelines, all public channels are now essential to implement deep linking to pass certification.

Implementation of Deep linking in Roku

Step 1: Modify the main method, by adding a parameter for accepting Deep linking.

[java]
Function Main (mainArgs as Dynamic) as Void

End Function
[/java]

Step 2: Now, check if the Roku channel is deep linked or not. If mainArgs.ContentID and mainArgs.MediaType both are not invalid then it is deep linked. If any of them are invalid then it is a normal channel.

[java]
Function Main (mainArgs as Dynamic) as Void
If (mainArgs.ContentId <> invalid) and (mainArgs.MediaType <> invalid)
print "Channel is deep linked"
End If
End Function
[/java]

Step 3: Implement the next step as per the Media Type and ContentId for a particular channel. Roku has media types such as movie, episode, short-form, special, live and season.

[java]
Function Main (mainArgs as Dynamic) as Void
If (mainArgs.ContentId <> invalid) and (mainArgs.MediaType <> invalid)
If (mainArgs.mediaType = “movie” )
print "Play Movie ", mainArgs.ContentId
Else If (mainArgs.mediaType = “live” )
print "Play Live ", mainArgs.ContentId
Else If (mainArgs.mediaType = “episode” )
print "Play Episode ", mainArgs.ContentId
Else If (mainArgs.mediaType = "short-form" or mainArgs.mediaType = "special" or mainArgs.mediaType = "season" )
print "Play ",mainArgs.mediaType, " ", mainArgs.ContentId
Else
‘Print an error message. Do not fail silently
print "Unknown Media Type = ", mainArgs.mediaType
End If
End If
End Function
[/java]

Testing of Deep linking in Roku

Method 1: curl -d ” ” ‘http://ip-address:8060/launch/dev?contentID=123456&MediaType=live’

Method 2: Deep linking tester app

Hope you will now be able to deep link easily following the steps mentioned in this blog.

Do check out my blogs for more updates.

FOUND THIS USEFUL? SHARE IT

comments (3)

  1. gene

    I’ve implemented, but deep linking isn’t working for me. Command only opens the app, won’t play the items. I’m suing the Simple Grid With Details template and RSS files to serve content. Any suggestions?

    Reply

Leave a Reply to gene Cancel reply

Your email address will not be published. Required fields are marked *