Deep Linking in Roku
Deep Linking is widely used for the purpose of launching the public channel, performing the universal search and for directly opening to a specific part of the video that is in a public channel. The Roku app developer needs to implement the deep linking in order to access a piece of video content directly rather than accessing it only from the home page. before Develop Roku app The latest Roku app development guidelines should be completely implement the deep link to pass the certification .
In this article, we have discussed the implementation process of deep linking in Roku by the Roku app developer.
What is Deep Linking in Roku?
Deep linking in Roku allows the users to get to their content quickly from the Roku UI via content discovery features of Roku such as Roku Search and Roku home screen banners. While deep linking in Roku, your channel is launched into content springboards or playback directly from the Roku UI. For instance, whenever you select a movie from Roku Search, immediately the playback starts without any navigation of the channels. This feature allows you to take the full advantages of Roku’s content discovery features for driving the users to your channel and increasing engagement.
What are the Deep Linking Parameters in a Roku Channel?
Deep link requests include two parameters: contentid and mediaType.
- A contentId can be defined with some valid ASCII string that is less than 255 characters in length. The Roku channel must have behaviors like handling invalid deep links, the unauthenticated users and displaying paywall when responding to the deep link request. In order to enable this deep linking, every piece of content present in the channel is identified by means of a unique string identifier.
- The next process step will be to associate a proper Roku defined mediaType with each contentId. The purpose of this mediaType is to convey to the Roku platform on handling the specific content. The content id must be an opaque string, a single string, URL encoded, as a command-line argument and be immutable. Once both the content id and media type are defined, they shouldn’t be changed until the Roku app is developed.
How to Implement Deep Linking in a Roku Channel?
The Roku app developer must follow the below series of steps to perform the deep linking process in the Roku Channel resulting in advanced Roku app development.
- Step 1: Modifying the main.brs file of the channel.
- Step 2: Testing the validity of args[contentid] and args[MediaType].
- Step 3: Adding code to launch.
- Step 4: For a series, implement bookmarking.
- Step 5: Using roInputEvent.
- Step 6: Testing with the help of Deep Linking in Roku Channel Tester application.
Now, as we have understood the basic steps required for deep linking in a Roku channel, let us understand them with some more clarity.
Step 1: Modifying the main.brs file of the channel
The Roku app developer has to first modify the Roku channel’s main.brs file in order to handle the deep linking. This can be done by either editing the Roku channel’s main() or the runuserinterface(). One more argument must be added to the function and can be named as args. The main() function must be modified so that the channel can accept the deep linking parameter easily.
This will be like, Function Main (args as Dynamic) as void.
The parameters of the function would be the contentId for defining a piece of content, the mediatype to identify the media type of the context and the third one is the correlator is the optional argument that is sent by ads during the launch of the channel.
Step 2: Testing the validity of args[contentid] and args[MediaType]
Adding the test code for args[contentid] and the args[MediaType]The code must be added in order to test the args[contentid] as well as the args[MediaType] are not the valid ones. In case these have values, then they are deep linked with So the testing condition will be like:
Function Main (mainArgs as Dynamic) as Void
If (mainArgs.ContentId <> invalid) and (mainArgs.MediaType <> invalid)
print “Channel is deep linked”
Step 3: Adding code to launch
The next step for implementing the deep linking in the Roku channel is to add the code for launching the required scene whenever the contentId is valid. In case they are invalid, the Roku app developer has to ensure that the corresponding error message gets displayed.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
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 End If End If End Function
Step 4: For a series, implement bookmarking
This should be followed by the implementation of bookmarking for the series. The decision must be taken as to which episode has to be played. Once decided, go to the specific episode part and begin the playback option. Precise knowledge on finding a suitable place for playback in the episode should be known.
Step 5: Using roInputEvent
When the channel is running, it is necessary to use the roInputEvent for the purpose of catching deep links thereby preventing the delays in the channel launching. Direct playback commands can be deep linked to channel content by the Roku developer.
Step 6: Testing with the help of Deep Linking in Roku Channel Tester application
The Roku developer must then test the process using the deep linking tester tool. One step is to try curl -d ” ” ‘http://ip-address:8060/launch/dev?contentID=123456&MediaType=live’ One can gain insights on testing the deep linking using the Roku deep linking tester tool.
We hope you will find this article helpful. After going through this article you will be easily able to implement deep linking in a Roku channel even if you are on a beginner level. You can also take help from several deep linking video lessons or by contacting 4 Way Technologies to get the best possible outcome as per your requirement.
A freelancing blogs and e-books writer who keeps you up with the trending technologies and user guides. A blogger who is currently a post-graduate living in United Kingdom and trying to make her niche as a Data Scientist. Before taking a deep dive into the "Data-World", she got a Bachelor's Technology degree in Computer Science and has always dreamed of writing as a kid which inspired her to write wonderful content with the right amount of technical terms to make it easy for the beginners and as well full-fledged developers to grasp a hold onto the computer technologies.