Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

AddOns

DFXP Captions with Embedded Styling

Here is a setup of the Captions plugin displaying heavily styled captions. The configuration options are used to define a basic style and the DFXP styling features are used to enhance this with a dedicated color for each speaker:

Note that DFXP captions only work in Flash mode, not in HTML5 yet.

DFXP File

Here are the contents of the DFXP captions file. You'll see both styles applied to paragraphs and styles applied to inline <span> tags (in case one caption contains multiple speakers):

<tt xmlns="http://www.w3.org/2006/10/ttaf1" xmlns:tts="http://www.w3.org/2006/04/ttaf1#styling">
  <head>
   <styling>
      <style id="jason" tts:color="#00FF00" />
      <style id="violet" tts:color="#FF0000" />
      <style id="sarah" tts:color="#FFCC00" />
      <style id="eileen" tts:color="#3333FF" />
   </styling>
  </head>
  <body>
    <div>
      <p begin="00:00:08" end="00:00:10" style="jason">Nothing is going on.</p>
      <p begin="00:00:10.5" end="00:00:12.5" style="sarah">You liar!</p>
      <p begin="00:00:13.5" end="00:00:15" style="violet">Are you?</p>
      <p begin="00:00:17" end="00:00:20" style="jason">Violet, please!<br/>
          <span style="violet">I am not your babe!</span></p>
      <p begin="00:00:24" end="00:00:29" style="jason">You stupid cow,<br/>
          look what you have done now, ay.</p>
      <p begin="00:00:34" end="00:00:36" style="jason">Vi, please.<br/>
          <span style="violet">Leave me alone!</span></p>
      <p begin="00:00:36" end="00:00:38.5" style="jason">We need to talk.<br/>
          <span style="violet">Jason, are you deaf?</span></p>
      <p begin="00:00:41" end="00:00:42.9" style="eileen">What's going on?</p>
      <p begin="00:00:43" end="00:00:45" style="eileen">Get out there<br/>
          and try to salvage this!</p>
    </div>
  </body>
</tt>

Note it's best practice to use the configuration options for general styling and the DFXP styling (or HTML in SRT) for doing specific overrides.