SoutheastTv
14 years agoVisitor
How to get instant updates to Roku?
I'm using the videoplayer example and I need Roku to update instantly when I change my xml files on the server. As it is now it takes hours for it to update or it updates sometimes when I repackage everything and send it to the channel as a new version.
Here is the code in categoryFeed.brs:
categories.xml
xmlfeed.php
awesomeness.xml
Here is the code in categoryFeed.brs:
Function InitCategoryFeedConnection() As Object
conn = CreateObject("roAssociativeArray")
conn.UrlPrefix = "http://scclib.com/demo/roku/xml"
conn.UrlCategoryFeed = conn.UrlPrefix + "/categories.xml?ts=" + dt.AsSeconds().ToStr()
conn.Timer = CreateObject("roTimespan")
conn.LoadCategoryFeed = load_category_feed
conn.GetCategoryNames = get_category_names
print "created feed connection for " + conn.UrlCategoryFeed
return conn
End Function
categories.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<categories>
<category title="Awesomeness" description="Here it iskhj"
sd_img="http://scclib.com/demo/roku/images/test_sd_poster.jpg"
hd_img="http://scclib.com/demo/roku/images/test_hd_poster.jpg">
<categoryLeaf title="Awesomeness" description="" feed="http://scclib.com/demo/roku/xml/xmlfeed.php"/>
</category>
</categories>
xmlfeed.php
<?php
echo file_get_contents('awesomeness.xml?ts=23423423');
?>
awesomeness.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed>
<resultLength>2</resultLength>
<endIndex>2</endIndex>
<item sdImg="" hdImg="">
<title>Awesomeness</title>
<contentId>10001</contentId>
<contentType>Talk</contentType>
<contentQuality>SD</contentQuality>
<media>
<streamFormat>mp4</streamFormat>
<streamQuality>SD</streamQuality>
<streamBitrate>1500</streamBitrate>
<streamUrl>http://vidego-http.multicastmedia.com/mm/flvmedia/2878/M/a/k/MakingTheMostofIt_wk1-865721.f4v?cid=2878&aid=865721&afid=1099746</streamUrl>
</media>
<synopsis>This is what's happening</synopsis>
<genres>Crap</genres>
<runtime>120</runtime>
</item>
</feed>