{"id":46725,"date":"2017-03-02T10:05:40","date_gmt":"2017-03-02T04:35:40","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=46725"},"modified":"2017-11-22T15:58:00","modified_gmt":"2017-11-22T10:28:00","slug":"deep-linking-in-roku","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/deep-linking-in-roku\/","title":{"rendered":"Deep Linking in Roku"},"content":{"rendered":"<p>Deep linking is used for launching the public channel, universal search and directly open to a particular video in a public channel.<\/p>\n<p><em>According to new <a title=\"Roku TV app development services\" href=\"http:\/\/www.tothenew.com\/mobile-smart-tv-application-development\">Roku development<\/a> guidelines, all public channels are now essential to implement deep linking to pass certification.<\/em><\/p>\n<p><strong>Implementation of Deep linking in Roku<\/strong><\/p>\n<p><strong>Step 1:<\/strong> Modify the main method, by adding a\u00a0parameter for accepting Deep linking.<\/p>\n<p>[java]<br \/>\nFunction Main (mainArgs as Dynamic) as Void<\/p>\n<p>End Function<br \/>\n[\/java]<\/p>\n<p><strong>Step 2:<\/strong> Now, check if the <a href=\"http:\/\/www.tothenew.com\/blog\/introduction-and-setup-in-roku-tv\/\">Roku channel<\/a> 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.<\/p>\n<p>[java]<br \/>\nFunction Main (mainArgs as Dynamic) as Void<br \/>\n\tIf (mainArgs.ContentId &lt;&gt; invalid) and (mainArgs.MediaType &lt;&gt; invalid)<br \/>\n    \tprint &quot;Channel is deep linked&quot;<br \/>\n\tEnd If<br \/>\nEnd Function<br \/>\n[\/java]<\/p>\n<p><strong>Step 3:<\/strong> 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.<\/p>\n<p>[java]<br \/>\nFunction Main (mainArgs as Dynamic) as Void<br \/>\n\tIf (mainArgs.ContentId &lt;&gt; invalid) and (mainArgs.MediaType &lt;&gt; invalid)<br \/>\n    \tIf (mainArgs.mediaType = \u201cmovie\u201d )<br \/>\n\t\t\tprint &quot;Play Movie &quot;, mainArgs.ContentId<br \/>\n\t\tElse If (mainArgs.mediaType = \u201clive\u201d )<br \/>\n\t\t\tprint &quot;Play Live &quot;, mainArgs.ContentId<br \/>\n\t\tElse If (mainArgs.mediaType = \u201cepisode\u201d )<br \/>\n\t\t\tprint &quot;Play Episode &quot;, mainArgs.ContentId<br \/>\n\t\tElse If (mainArgs.mediaType = &quot;short-form&quot; or mainArgs.mediaType = &quot;special&quot; or mainArgs.mediaType = &quot;season&quot; )<br \/>\n\t\t\tprint &quot;Play &quot;,mainArgs.mediaType, &quot; &quot;, mainArgs.ContentId<br \/>\n\t\tElse<br \/>\n\t\t\t&#8216;Print an error message.  Do not fail silently<br \/>\n    \t\tprint &quot;Unknown Media Type = &quot;, mainArgs.mediaType<br \/>\n\t\tEnd If<br \/>\n\tEnd If<br \/>\nEnd Function<br \/>\n[\/java]<\/p>\n<p><strong>Testing of Deep linking in Roku<\/strong><\/p>\n<p><strong>Method 1:<\/strong> curl -d &#8221; &#8221; &#8216;http:\/\/ip-address:8060\/launch\/dev?contentID=123456&amp;MediaType=live&#8217;<\/p>\n<p><strong>Method 2:<\/strong> <a title=\"Deep linking tester app\" href=\"https:\/\/devtools.web.roku.com\/DeepLinkingTester\/\"> Deep linking tester app<\/a><\/p>\n<p>Hope you will now be able to deep link easily following the steps mentioned in this blog.<\/p>\n<p>Do check out my blogs for more updates.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":167,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":17},"categories":[3479,3477,1],"tags":[4479,4478,4480,3474,4481,3644,4492,4491,4482],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/46725"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/167"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=46725"}],"version-history":[{"count":1,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/46725\/revisions"}],"predecessor-version":[{"id":52467,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/46725\/revisions\/52467"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=46725"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=46725"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=46725"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}