Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
tvjay
Channel Surfer

HLS/MP4 in MRSS

I am trying to mix HLS with MP4 using the MRSS template. The HLS streams will be referenced via an XML file as they will not change but the MP4s will be from a very fluid RSS feed. All the data is working however when playing video the MP4 files work just fine but my HLS streams fail to load. From reading other post I think I need to use the function DisplayVideo from another SDK to play HLS. My problem, I just don't know how to tell the Roku to use showVideoScreen (the default function for playing video in MRSS) for MP4 and use DisplayVideo (the new function) for HLS. I have been able to bring over a data string from my XML called streamFormat by adding these lines to NWM_MRSS...

' streamFormat
if item.GetNamedElements("streamFormat").Count() > 0
tmp = item.GetNamedElements("streamFormat")
newItem.streamFormat = ValidStr(tmp[0].GetText())
end if


...and defined a varible <streamFormat>video/hls</streamFormat> in my XML. However, whenever I try to pass that varible I get "<UNINITIALIZED>". My question is, how do I pass that varible onto appVideoScreen.brs and make a IF statement to decide which function to use.

Also, I have read lots of post on parsing extentions but it never work for me as enclosure@type never returns any data and that whole IF/ELSE loop just gets skipped over.
0 Kudos
1 REPLY 1
RokuRobB
Streaming Star

Re: HLS/MP4 in MRSS

There is a content meta data attribute called StreamFormat which you can use to specify the format of a specific stream: http://sdkdocs.roku.com/display/sdkdoc/ ... +Meta-Data

Basically I would define your XML to do <streamFormat>hls</streamFormat> or <streamFormat>mpg</streamFormat> depending on the format of the corresponding stream. Then you would just parse out the value of this tag from the XML, and set the StreamFormat content meta data property to that value.
0 Kudos