Having trouble getting deep linking to work in my Roku channel.I've done a lot of reading on the Roku SDK (particularly their Deep Linking Doc) and a variety of forums. However, I'm just not making any headway.Currently, my channel uses the Simple Grid with Details template, which serves video content via RSS files.Here's the beginning of my main.brs file:sub Main(args as Dynamic) as Void
showSGScreen(args)
if (args.mediaType <> invalid) and (args.contentID <> invalid)
if (args.mediaType = "movie" or args.mediaType = "episode" or args.mediaType = "short-form" or args.mediaType = "series" or args.mediaType = "special")
'play content directly
else
'deep linking issue such as a contentID not matching any content in the partner's catalog
'display an appropriate error message for the user
end if
else
'launch channel normally
end if
end sub
Sub RunUserInterface()
screen = CreateObject("roSGScreen")
scene = screen.CreateScene("HomeScene")
port = CreateObject("roMessagePort")
screen.SetMessagePort(port)
screen.Show()
oneRow = GetApiArray1()
twoRow = GetApiArray2()
threeRow = GetApiArray3()
fourRow = GetApiArray4()
list = [
{
TITLE : "Watch Our Services Live"
ContentList : oneRow
}
{
TITLE : "Without Ceasing: A Series On Prayer"
ContentList : twoRow
}
{
TITLE : "The Least Of These: Hope, Help, Heal"
ContentList : threeRow
}
{
TITLE : "The Bible: Learning To Live It"
ContentList : fourRow
}
]
scene.gridContent = ParseXMLContent(list)
while true
msg = wait(0, port)
print "------------------"
print "msg = "; msg
end while
if screen <> invalid then
screen.Close()
screen = invalid
end if
End Sub
Function ParseXMLContent(list As Object)
RowItems = createObject("RoSGNode","ContentNode")
for each rowAA in list
'for index = 0 to 1
row = createObject("RoSGNode","ContentNode")
row.Title = rowAA.Title
for each itemAA in rowAA.ContentList
item = createObject("RoSGNode","ContentNode")
' We don't use item.setFields(itemAA) as doesn't cast
streamFormat to proper value
for each key in itemAA
item[key] = itemAA[key]
end for
row.appendChild(item)
end for
RowItems.appendChild(row)
end for
return RowItems
End Function
Function GetApiArray1()
url = CreateObject("roUrlTransfer")
url.SetUrl("http://media.genepensiero.com/roku/rss/livestream.rss")
rsp = url.GetToString()
responseXML = ParseXML(rsp)
responseXML = responseXML.GetChildElements()
responseArray = responseXML.GetChildElements()
result = []
for each xmlItem in responseArray
if xmlItem.getName() = "item"
itemAA = xmlItem.GetChildElements()
if itemAA <> invalid
item = {}
for each xmlItem in itemAA
item[xmlItem.getName()] = xmlItem.getText()
if xmlItem.getName() = "media:content"
item.stream = {url : xmlItem.url}
item.url = xmlItem.getAttributes().url
item.streamFormat = "hls"
mediaContent = xmlItem.GetChildElements()
for each mediaContentItem in mediaContent
if mediaContentItem.getName() =
"media:thumbnail"
item.HDPosterUrl =
mediaContentItem.getattributes().url
item.hdBackgroundImageUrl =
mediaContentItem.getattributes().url
end if
end for
end if
end for
result.push(item)
end if
end if
end for
return result
End Function
Then an example of an entry in my RSS feed is:<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
<channel>
<title>Bright Light Church</title>
<link />
<description>Live and Archived Bible Studies</description>
<language>en-us</language>
<pubDate>Wed, 26 Apr 2017 12:00:00 PT</pubDate>
<category>TV & Film</category>
<image>
<title>The Bible</title>
<url>http://media.genepensiero.com/roku/withoutceasing.jpg</url>
<width>-1</width>
<height>-1</height>
</image>
<item>
<title>Prayer Pressure</title>
<link>http://media.calvaryhanford.com/psalms/prayerpressure.mp4</link>
<description>David brings big requests to God and receives a big revelation.</description>
<pubDate>Sun, 05 Mar 2017 10:15:00 PT</pubDate>
<guid isPermaLink="false">ch001</guid>
<media:content channels="2" type="special" isDefault="true" id="ch001" url="http://media.calvaryhanford.com/psalms/prayerpressure.mp4">
<media:description>David brings big requests to God and receives a big revelation.</media:description>
<media:keywords>church, bible study, expository sermon</media:keywords>
<media:thumbnail url="http://media.genepensiero.com/roku/withoutceasing.jpg" />
<media:title>Prayer Pressure</media:title>
</media:content>
</item>
When I use the Deep Link Tester it just opens my channel to the home screen, it doesn't launch the specific video.Any insight would be appreciated.