Search code examples
vimeovimeo-apirokubrightscript

Play Vimeo Link On Roku With Ampersand


So I have a Roku channel that is completely powered by Vimeo. However, the other day Vimeo changed around some of their links that are included in the API call. Now, all the links have an ampersand in the URL to the videos.

In the past when we had our own CDN I could create scripts and links at will to not include an ampersand. However, I am still using the simple video player example that came with the Roku SDK examples and for some reason video links with ampersands will not play.

Is there something in the Brightscript code that I need to change to play links with ampersands?

How can I change this channel around to work with video URLS that contain ampersands?


Solution

  • Hmmm, i cannot think of a reason why Roku won't load files with & in the URL.

    But i have a suspicion the reason may be somewhere else: do you by any chance pass the content (list of videos etc) to the player as XML? You should make sure ampersands in text and attribute values for XML are escaped to & - otherwise roXmlElement.parse(xmlText) acts unreasonably. And by "unreasonably" i don't mean it loses the & or shows error, rather it silently drops whole elements or subtrees.

    Pro tip: if parsing XML on Roku and suspecting something might have got lost in parsing, use myXmlElem.genXML() to dump it back to console.