keeptalking
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2016
07:31 AM
Using xml from remote server
Hi all,
I am trying to understand and alter the sample code from the "videolist" example. I want to change it so it gets the xml video listing from my own remote server rather than having it hard coded into the app. I know I need to change this section to point to my server:
Unfortunately my level of understanding is still poor and I cannot figure out how to alter the code.
I will be eternally grateful if someone can help!
Many thanks,
Mark
I am trying to understand and alter the sample code from the "videolist" example. I want to change it so it gets the xml video listing from my own remote server rather than having it hard coded into the app. I know I need to change this section to point to my server:
m.readVideoContentTask = createObject("RoSGNode","VideoContentReader")
m.readVideoContentTask.observeField("videocontent","showvideolist")
m.readVideoContentTask.videocontenturi = "pkg:/server/videocontent.xml"
m.readVideoContentTask.control = "RUN"
Unfortunately my level of understanding is still poor and I cannot figure out how to alter the code.
I will be eternally grateful if someone can help!
Many thanks,
Mark
8 REPLIES 8
renojim
Community Streaming Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2016
10:44 AM
Re: Using xml from remote server
Change:
to:
where yourserver and yourcontent are obviously dependent on your situation.
-JT
m.readVideoContentTask.videocontenturi = "pkg:/server/videocontent.xml"
to:
m.readVideoContentTask.videocontenturi = "http://yourserver/yourcontennt.xml"
where yourserver and yourcontent are obviously dependent on your situation.
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
keeptalking
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2016
11:04 AM
Re: Using xml from remote server
For some reason this doesn't work - Roku fails to load the xml. The server is working fine (I'm also streaming the test videos from it), and the path to the xml file is definitely right.
Any ideas welcome!
Thanks,
Mark
Any ideas welcome!
Thanks,
Mark
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2016
01:29 PM
Re: Using xml from remote server
"keeptalking" wrote:
Hi all,
I am trying to understand and alter the sample code from the "videolist" example. I want to change it so it gets the xml video listing from my own remote server rather than having it hard coded into the app.
What "videolist" example? Give exact URL! This is important.
PS. I looked inside the VideoListExample.zip from RTFM https://sdkdocs.roku.com/display/sdkdoc/Media+Playback+Markup#MediaPlaybackMarkup-VideoListMarkup and that is NOT what you are using. What are you using?!
keeptalking
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2016
02:18 PM
Re: Using xml from remote server
Hi,
Thanks for your help.
I am using this example:
https://sdkdocs.roku.com/download/attac ... 629&api=v2
Cheers,
Mark
Thanks for your help.
I am using this example:
https://sdkdocs.roku.com/download/attac ... 629&api=v2
Cheers,
Mark
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2016
03:15 PM
Re: Using xml from remote server
"keeptalking" wrote:
I am using this example:
https://sdkdocs.roku.com/download/attac ... 629&api=v2
Good grief, yet another copy of that - but slightly different. Why are RokuCo's examples such a mess?!
Why are there multiple copies in multiple places - how is one to know which is what, where is the consistency, where is a "catalog" to pick and choose?
@keepTalking - look inside videoContentReader.xml of "your" zip:
' uncomment/conditionalize for development package XML transfers (pkg:/server/foo.xml)'
xmlstring = ReadAsciiFile(m.top.videocontenturi)
videocontentxml.parse(xmlstring)
' uncomment/conditionalize for published channel Internet XML transfers (http://serverdomain/foo.xml)'
' readInternet = createObject("roUrlTransfer")'
' readInternet.setUrl(m.top.foocontentxmluri)'
' foocontentxml.parse(readInternet.GetToString())'
Comment out the first part, un-comment the 2nd.
Oh, and change foocontentxml -> videocontentxml, foocontentxmluri -> videocontenturi
Oh, and it's up to you to add code to check if the URL xfer has failed.
The Story of O...
keeptalking
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2016
11:31 AM
Re: Using xml from remote server
Hi,
Many thanks for this - it now works perfectly. Maybe Roku can offer you a job rewriting their docs? 😉
Your help is greatly appreciated.
Mark
Many thanks for this - it now works perfectly. Maybe Roku can offer you a job rewriting their docs? 😉
Your help is greatly appreciated.
Mark
norcaljohnny
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2017
04:26 PM
Re: Using xml from remote server
This unfortunately does not work for me. Im stumped. Sadly, this is why so many use sample templates untouched because docs are outdated, depreciated or flat out do not work. Sighs....
Ok. So for me,
djusting these lines worked.
Ok. So for me,
djusting these lines worked.
readInternet.setUrl(m.top.videocontenturi)
videocontentxml.parse(readInternet.GetToString())
m.readVideoContentTask.observeField("videocontent","showvideolist")
m.readVideoContentTask.videocontenturi = "http://your-domain/videocontent.xml"
m.readVideoContentTask.control = "RUN"
xwilly
Reel Rookie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2020
06:19 PM
Re: Using xml from remote server
Hi, I am using the VideoListExample as well and I need to add a Http Header when I call the URLs of the streams stored in the XML.
The Http Header is the user agent and will be the same for each stream.
Can someone help me with the right piece of code to add?
Thanks