Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
Showing results for 
Search instead for 
Did you mean: 
Level 7

HLS Subtitles Not Working


I am trying to get subtitles working with the following stream. I am unable to get subtitles to show.
I have used the below stream, ... ylist.m3u8 to test. In VLC, the steam works fine for subtitles. I have also used our own streams which I will be happy to PM if you need to further debug. I just can't get this to work with HLS streaming at all on Roku 3.
Sub Main()
print "Displaying video: "
p = CreateObject("roMessagePort")
video = CreateObject("roVideoScreen")

videoclip = CreateObject("roAssociativeArray")
videoclip.StreamBitrates = [0]

videoclip.StreamUrls = [""]

di = CreateObject("roDeviceInfo")
if di.GetDisplayType() = "HDTV" then
end if

subtitle_config = {
TrackName: "eia608/1"

videoclip.StreamFormat = "hls"
videoclip.Title = "Title of channel"
videoclip.SubtitleUrl = ""
videoclip.SubTitleConfig = subtitle_config


while true
msg = wait(0, video.GetMessagePort())
if type(msg) = "roVideoScreenEvent"
if msg.isScreenClosed() then 'ScreenClosed event
print "Closing video screen"
exit while
else if msg.isPlaybackPosition() then
nowpos = msg.GetIndex()
if nowpos > 10000

end if
if nowpos > 0
if abs(nowpos - lastSavedPos) > statusInterval
lastSavedPos = nowpos
end if
end if
else if msg.isRequestFailed()
print "play failed: "; msg.GetMessage()
print "Unknown event: "; msg.GetType(); " msg: "; msg.GetMessage()
end if
end while
end Sub
0 Kudos
3 Replies
Level 10

Re: HLS Subtitles Not Working

It might be nothing, but did you go into the roku settings screen and enable captions?
0 Kudos
Level 7

Re: HLS Subtitles Not Working

I have and when I click on the asterisk, I receive "Caption not available" and "audio selection not available"
0 Kudos
Level 7

Re: HLS Subtitles Not Working

You're explicitly setting the SubtitleUrl to an empty string. I wonder if that's overriding the SubtitleConfig. Try commenting out that line and see if it makes a difference. Alternatively, you could comment out the SubtitleConfig and just set the SubtitleUrl to "eia608/1" which is what I tend to do if there's only one subtitle option.
My Channels: - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos