mrss feed hls

Hello. I am using a modified version of the mrss template. I am trying to get the hls stream to play but it keeps erroring out.

in my nwm_mrss.brs file have i have this code snippet


' streamFormat
             		if item.enclosure.count() > 0
                		for each enclosure in item.enclosure
                
                	if item.enclosure@type = "video/hls"
                   		fileFormat = "hls"
                		else if item.enclosure@type = "video/x-mp4"
                   		fileFormat = "mp4"
						else if item.enclosure@type = "video/mp4"
						fileFormat = "mp4"
                		else if fileFormat = ""
                	end if
                
                	newItem.streamFormat = fileFormat
                		end for
             		end if

here is the debug error

showHomeScreen | msg = An unexpected problem (but not server timeout or HTTP error) has been detected. | index = -3
Video request failure: -3 0
showHomeScreen | msg = | index = 0
Screen closed

Any help is appreciated.

Thanks

First step, make sure your content-meta-data structure is being populated with what you intend. There’s a line in appVideoScreen.brs that you can un-comment to dump the structure to the console and examine it.

  'Uncomment his line to dump the contents of the episode to be played
  'PrintAA(episode)

Thanks. I will look into that. I know the url worked using the video player template.

I’m wondering if this matches the type you have in the url?

if item.enclosure@type = "video/hls"

You could try changing your if statement so it defaults to “hls”. The streamformat is one of the few mandatory parameters needed to play successfully, so that’s the first place to look. Definately uncomment like Chris said. Gotta see the big picture :slightly_smiling_face:

thanks. looking into that now. here are the contents of the m3u8 file.

#EXTM3U
#EXT-X-VERSION:2
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=522183,CODECS=“avc1.66.31, mp4a.40.34”,RESOLUTION=640x360

Thanks for everyone’s help. I managed to get this working. It is still strange the mrss feed template didnt play the feed when forced to “hls” by default.