Ohhhh -- what is the _getXmlString method you used in the first post? How does it work and does it return a string or a xml element?
If I understand correctly, streamurl is in XML? In that case you might want to create a roXMLElement so that you can get the HLS stream as a string:
https://sdkdocs.roku.com/display/sdkdoc/roXMLElement So you create a roXMLElement (call it x, for simplicity) and use its parse() method on the XML EG you had: <streamUrl>http://stream/playlist.m3u8?id=</streamUrl> (call it "str")
I.e.
x =createObject("roXMLElement")
x.parse(str)
Then get the text:
somestring = x.getText()
Which will output the HLS Stream as a string (stored in variable somestring above)
Then, if Key is a string, append it by doing something like:
somestring = somestring + "1345n349jc380mcvw87wcd2"
Not sure if that's the case, let me know if that works
😄 If you're having trouble understanding how to use roXMLElement, take a look at this example below:
if str = invalid return
xml = CreateObject("roXMLElement")
' Return invalid if string can't be parsed
if not xml.Parse(str) return
if xml <> invalid then
xml = xml.getchildelements()
responsearray = xml.getchildelements()
end if
result = []
'responsearray - <channel>'
for each xmlitem in responsearray
' <title>, <link>, <description>, <pubDate>, <image>, and lots of <item>'s
if xmlitem.getname() = "item"
' All things related to one item (title, link, description, media:content, etc.)
itemaa = xmlitem.getchildelements()
if itemaa <> invalid
item = {}
' Get all <item> attributes
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 = "mp4"
mediacontent = xmlitem.getchildelements()
for each mediacontentitem in mediacontent
if mediacontentitem.getname() = "media:thumbnail"
item.hdposterurl = mediacontentitem.getattributes().url
item.hdbackgroundimageurl = mediacontentitem.getattributes().url
item.uri = mediacontentitem.getattributes().url
end if
end for
end if
end for
result.push(item)
end if
end if
end for