I am trying to learn Roku channel development. I took the “videoplayer” example and was going to experiment with the category feeds. I discovered that the category files were present in the application’s tree as well as online, and I changed the line:
to pull the local copy of the file instead of hitting the web server at rokudev.roku.com. The only other change i made was to add a debugging line after the “Can’t parse feed” so I could see the results of the fetch of the URL:
if not xml.Parse(rsp) then
print "Can't parse feed"
print "'" + rsp + "'"
return invalid
endif
It looks like the HTTP fetch returns nothing:
created feed connection for file://pkg:/xml/categories.xml
url: file:///tmp/plugin/FDAAAA1tnmYw/pkg:/xml/categories.xml
Took: 5ms
Can't parse feed
''
No joy in mudville. The app doesn’t seem to run at all - connecting to the debug port 8085 yields nothing.
At a minimum is should state it’s running the code, and it should give you an error message and the debugging console if there’s an error. Sometimes it seems the debugging port can get stuck for me (if, for example, I let the computer go to sleep and time out the telnet connection), and I need to reset the Roku.
If you’re using included makefile to package and install the sample channel, the xml directory will be excluded from the package, which could cause the problem you’re seeing.
Doh! Should have done more checking, but I’m new to this. That did the trick. Hopefully I wont’ be pestering you all anymore (at least not for a while).
“RokuChris” wrote:
Also, you can’t read a local file using roURLTransfer. You’ll need to use ReadASCIIFile() as documented on p34 of the BrightScript Reference Manual.
FYI you can read a local file using roURLTransfer just as with a web browser, the URL syntax is “file://pkg:/xml/categories.xml”.