Roku Developer Program

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

Requesting Sample code for rendering subtitles (TTML)

Hi,

We are using Dash and HLS video protocols, as we see from "https://sdkdocs.roku.com/display/sdkdoc/Closed+Caption+Support#ClosedCaptionSupport-ClosedCaptionSupportSummary" , the subtitles need to provide externally.

We are using screen graph video element. Requesting for sample code for rendering TTML subtitles in video element of screen graph


Thanks and Regards
BHARATH SN
0 Kudos
1 Reply
Highlighted
Level 7

Re: Requesting Sample code for rendering subtitles (TTML)

my sample code

<?xml version = "1.0" encoding = "utf-8" ?>

<!--********** Copyright 2016 Roku Corp.  All Rights Reserved. **********-->

<component name = "facade" extends = "Scene">
<script type="text/brightscript" >
      <![CDATA[
      sub init()
        m.top.setFocus(true)
        setVideo()
      end sub

      function setVideo() as void
        videoContent = createObject("RoSGNode", "ContentNode")
        videoContent.url = "http://yt-dash-mse-test.commondatastorage.googleapis.com/media/motion-20120802-manifest.mpd"
        videoContent.title = ""
        videoContent.streamformat = "dash"
        videoContent.SubtitleUrl = "pkg:/ttml/ttml.xml"

        m.video = m.top.findNode("musicvideos")
        m.video.content = videoContent
        m.video.control = "play"
        m.video.setFocus(true)
      end function
      ]]>
</script>
  <children >
      <Video
        id="musicvideos"
        width="1920"
        height="1080"
        translation="[0,0]"
        enableUI="true"
      />
  </children>
</component>
0 Kudos