Deep Linking in Roku
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.
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?
Yes, I like to read this blog about deep link in Roku. That’s an amazing blog such a grateful. Thank You.
Very useful information, helped me understand deep linking in more depth.