Skip to main content

Roku Development – hls support

It took me sometime to figure this out, so I am posting this here for all of you stuck in this too!

If you got to this page you are probably trying to create a nice ROKU channel and started with the RokuSDK\examples\zips\simplevideoplayer.zip

You deploy the app, and you see that it has a nice interface but all the examples in the feeds are mp4 files and not hls. So you figure, ok, I ll take the example code and I will replace “mp4” with “hls” and then on the content, I will replace the mp4 file with my m3u8 stream. Then you try it and you see nothing..

Here is the original piece of code :

  1. <media>
  2. <streamFormat>mp4</streamFormat>
  3. <streamQuality>SD</streamQuality>
  4. <streamBitrate>1500</streamBitrate>
  5. <streamUrl>http://video.ted.com/talks/podcast/ElizabethGilbert_2009_480.mp4</streamUrl>

Here is the modified piece of code :

  1. <media>
  2. <streamFormat>hls</streamFormat>
  3. <SwitchingStrategy>full-adaptation</SwitchingStrategy>
  4. <streamQuality>HD</streamQuality>
  5. <streamBitrate>500</streamBitrate>
  6. <streamUrl>http://megahdlive1-f.akamaihd.net/i/[email protected]/master.m3u8</streamUrl>
  7. </media>

 

And here is the solution to your problems! :

On line 165 (or anywhere else really) on the file showFeed.brs you need to add the following code :

  1. If item.StreamFormat="hls"
  2. item.SwitchingStrategy="full-adaptation"
  3. End If

 

You may download the modified showFeed.brs

upggr

I am the one