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: 
gpasq
Visitor

HLS quality issue

I'm streaming HLS video in my app and I'm running into a problem. When I feed the video player a playlist URL, it always picks (and sticks with) the lowest resolution stream. The playlist file looks like:

#EXTM3U
#EXT-X-VERSION:2
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=596000,CODECS="avc1.4d001f,mp4a.40.2",RESOLUTION=320x180
01.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1096000,CODECS="avc1.4d001f,mp4a.40.2",RESOLUTION=640x360
02.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1596000,CODECS="avc1.4d0028,mp4a.40.2",RESOLUTION=864x486
03.m3u8

If I construct a URL using the highest res stream (03.m3u8) "by hand" and give it to teh player, it plays high res, as expected. But if I just give it the URL to get the above playlist, it just plays 01.m3u8

Any thoughts how I can get to play the highest resolution feed?
0 Kudos
2 REPLIES 2
RokuJoel
Binge Watcher

Re: HLS quality issue

Make sure to set switchingStrategy="full-adaptation" on your media object:

...
video.switchingStrategy="full-adaptation"

di = CreateObject("roDeviceInfo")
if di.GetDisplayType() = "HDTV" then
video.streamqualities=["HD"]
else
video.streamqualities=["SD"]
end if
video.StreamBitrates=[0]
videoscreen.setcontent(video)
videoscreen.play()
...
0 Kudos
gpasq
Visitor

Re: HLS quality issue

Ah, that did it. Awesome, thanks!
0 Kudos