Forum Discussion

Jchrome's avatar
Jchrome
Visitor
12 years ago

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/

2 Replies

  • 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