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

Adding Subtitles to Channels with XML feeds

Hi,
I am new to roku development. I have successfully gone through the majority of the steps in the "How Do I Start Developing a Channel?" post in this forum, and manage to get the videoplayer example with xml feeds working. I want to add subtitle capability to this app allowing a user to watch the videos with subtitles if they please. I noticed the simplevideoplayer example, as well as the entry in the Roku Developer Blog covering the CaptionRender example (link below), both cover adding subtitles in the BightScript (*.brs) file. How can I do this for an app using xml feeds like the videoplayer example in the SDK? Thanks in advance for the help.

http://blog.roku.com/developer/2014/01/ ... evelopers/
0 Kudos
2 REPLIES 2
RokuJoel
Binge Watcher

Re: Adding Subtitles to Channels with XML feeds

add a tag like:

<srt>http://myserver.com/videos/myvideo.srt</srt>


to your xml:

item sdImg="http://rokudev.roku.com/rokudev/examples/videoplayer/images/JeffHan.jpg" hdImg="http://rokudev.roku.com/rokudev/examples/videoplayer/images/JeffHan.jpg">
<title>Jeff Han demos his breakthrough touchscreen</title>
<srt>http://myserver.com/videos/myvideo.srt</srt>
<contentId>10061</contentId>
<contentType>Talk</contentType>
<contentQuality>SD</contentQuality>
<streamFormat>mp4</streamFormat>
<media>
<streamQuality>SD</streamQuality>
<streamBitrate>1500</streamBitrate>
<streamUrl>http://video.ted.com/talks/podcast/JeffHan_2006_480.mp4</streamUrl>
</media>
<synopsis>After years of research on touch-driven computer displays, Jeff Han has created a simple, multi-touch, multi-user screen interface that just might herald the end of the point-and-click era.</synopsis>
<genres>Design</genres>
<runtime>531</runtime>
</item>


and in showFeed.brs near the bottom:


item.SubtitleURL=validstr(curShow.srt.GetText())
item.SDBifUrl= validstr(curShow.sdBifUrl.GetText())
item.StreamFormat = validstr(curShow.streamFormat.GetText())


That _should_ do the trick, assuming you have a valid .srt file.

- Joel
0 Kudos
Jchrome
Visitor

Re: Adding Subtitles to Channels with XML feeds

That worked perfectly. Thanks a lot.
0 Kudos