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

HLS Subtitles Not Working

Hello,

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, http://playertest.longtailvideo.com/ada ... 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")
video.setMessagePort(p)

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

videoclip.StreamUrls = ["http://playertest.longtailvideo.com/adaptive/captions/playlist.m3u8"]

di = CreateObject("roDeviceInfo")
if di.GetDisplayType() = "HDTV" then
videoclip.streamqualities=["HD"]
else
videoclip.streamqualities=["SD"]
end if

subtitle_config = {
TrackName: "eia608/1"
}

videoclip.StreamFormat = "hls"
videoclip.Title = "Title of channel"
videoclip.SubtitleUrl = ""
videoclip.switchingstrategy="full-adaptation"
videoclip.SubTitleConfig = subtitle_config

video.SetContent(videoclip)
video.show()


while true
msg = wait(0, video.GetMessagePort())
if type(msg) = "roVideoScreenEvent"
if msg.isScreenClosed() then 'ScreenClosed event
print "Closing video screen"
return
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()
else
print "Unknown event: "; msg.GetType(); " msg: "; msg.GetMessage()
endif
end if
end while
end Sub
0 Kudos
3 REPLIES 3
destruk
Streaming Star

Re: HLS Subtitles Not Working

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

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
TheEndless
Channel Surfer

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: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.