Use Timed Text captions

The FLVPlaybackCaptioning component enables captioning for the associated FLVPlayback component by downloading a Timed Text (TT) XML file. For more information about Timed Text format, review the AudioVideo Timed Text information at www.w3.org.

This section provides an overview of the supported Timed Text tags, the required captioning file tags, and an example of a Timed Text XML file. For detailed information on all the supported Timed Text tags, see Timed Text tags .

The FLVPlaybackCaptioning component supports the following Timed Text tags:

Category

Task

Paragraph formatting support

Align a paragraph right, left, or center

Text formatting support

  • Set the size of the text with absolute pixel sizes or delta style (for example, +2, -4)

  • Set the text color and font

  • Make text bold and italic

  • Set text justification

Other formatting support

  • Set the background color of the TextField for captions

  • Set the background color of the TextField for captions to transparent (alpha 0)

  • Set the word wrap of the TextField for captions (on or off)

The FLVPlaybackCaptioning component matches the time code of the FLV file. Every caption must have a begin attribute, which determines when the caption should appear. If the caption does not have a dur or end attribute, the caption disappears when the next caption appears, or when the FLV file ends.

The following is an example of a Timed Text XML file. This file (caption_video.xml) provides captioning for the caption_video.flv file. Access these files at www.helpexamples.com/flash/video/caption_video.flv and www.helpexamples.com/flash/video/caption_video.xml .

<?xml version="1.0" encoding="UTF-8"?> 
    <tt xml:lang="en" xmlns="http://www.w3.org/2006/04/ttaf1"xmlns:tts="http://www.w3.org/2006/04/ttaf1#styling"> 
<head> 
    <styling> 
<style id="1" tts:textAlign="right"/> 
<style id="2" tts:color="transparent"/> 
<style id="3" style="2" tts:backgroundColor="white"/> 
<style id="4" style="2 3" tts:fontSize="20"/> 
    </styling> 
</head> 
<body> 
    <div xml:lang="en"> 
<p begin="00:00:00.00" dur="00:00:03.07">I had just joined <span tts:fontFamily="monospaceSansSerif,proportionalSerif,TheOther"tts:fontSize="+2">Macromedia</span> in 1996,</p> 
<p begin="00:00:03.07" dur="00:00:03.35">and we were trying to figure out what to do about the internet.</p> 
<p begin="00:00:06.42" dur="00:00:03.15">And the company was in dire straights at the time.</p> 
<p begin="00:00:09.57" dur="00:00:01.45">We were a CD-ROM authoring company,</p> 
<p begin="00:00:11.42" dur="00:00:02.00">and the CD-ROM business was going away.</p> 
<p begin="00:00:13.57" dur="00:00:02.50">One of the technologies I remember seeing was Flash.</p> 
<p begin="00:00:16.47" dur="00:00:02.00">At the time, it was called <span tts:fontWeight="bold" tts:color="#ccc333">FutureSplash</span>.</p> 
<p begin="00:00:18.50" dur="00:00:01.20">So this is where Flash got its start.</p> 
<p begin="00:00:20.10" dur="00:00:03.00">This is smart sketch running on the <span tts:fontStyle="italic">EU-pin computer</span>,</p> 
<p begin="00:00:23.52" dur="00:00:02.00">which was the first product that FutureWave did.</p> 
<p begin="00:00:25.52" dur="00:00:02.00">So our vision for this product was to</p> 
<p begin="00:00:27.52" dur="00:00:01.10">make drawing on the computer</p> 
<p begin="00:00:29.02" dur="00:00:01.30" style="1">as <span tts:color="#ccc333">easy</span> as drawing on paper.</p> 
</div> 
</body> 
</tt>

Timed Text tags

The FLVPlaybackCaptioning component supports Timed Text tags for captioning XML files. For more information about the Audio Video Timed Text tags, review information at www.w3.org . The following table lists supported and non-supported tags.

Function

Tag/Value

Usage/Description

Example

Ignored tags

metadata

Ignored / allowed at any level of the document

set

Ignored / allowed at any level of the document

xml:lang

Ignored

xml:space

Ignored / Behavior overrides to:

xml:space="default"

layout

Ignored / including any region tags in a layout tag section

br tag

All attributes and contents are ignored.

Media Timing for Captions

begin attributes

Allowed in p tags only. Required for media time deployment of captions.

<p begin="3s">

dur attributes

Allowed in p tags only. Recommended. If not included, the caption ends with the FLV file or when another caption starts.

end attributes

Allowed in p tags only. Recommended. If not included, the caption ends with the FLV file or when another caption starts.

Clock Timing for Captions

00:03:00.1

Full clock format

03:00.1

Partial clock format

10

Offset times without units. Offset represents seconds.

00:03:00:05

00:03:00:05.1

30f

30t

Not supported. Time formats that include frames or ticks are not supported.

Body tag

body

Required / Support for only one body tag.

<body><div>...</div></body>

Content tag

div tag

Zero or more allowed. The first tag is used.

p tag

Zero or more allowed.

span tag

A logical container for a sequence of textual content units. No support for nested spans. Support for attribute style tags.

br tag

Denotes an explicit line break.

Styling Tags

(All style tags are used within the p tag)

style

Reference one or more style elements. Can be used as a tag and as an attribute. As a tag, an ID attribute is required (the style can be reused in the document). Support for one or more style tags inside style tag.

tts:background Color

Specify a style property that defines the background color of a region. Alpha is ignored unless set to zero (alpha 0) to make the background transparent. The color format is #RRGGBBAA.

tts:color

Specify a style property that defines the foreground color. Alpha not supported for any colors. Value transparent translates to black.

<style id="3" style="2" tts:backgroundColor="white"/>

"transparent" = #00000000

"black"=#000000FF

"silver"=#C0C0C0FF

"grey"=#808080FF

"white"=#FFFFFFFF

"maroon"=#800000FF

"red"=#FF0000FF

"purple"=#800080FF

"fuchsia"("magenta")=

#FF00FFFF

"green"=#008000FF

"lime"=#00FF00FF

"olive"=#808000FF

"yellow"=#FFFF00FF

"navy"=#000080FF

"blue"=#0000FFFF

"teal"=#008080FF

"aqua"("cyan")=#00FFFFFF

tts:fontFamily

Specify a style property that defines the font family.

"default" = _serif

"monospace" = _typewriter

"sansSerif" = _sans

"serif" = _serif

"monospaceSansSerif" = _typewriter

"monospaceSerif" = _typewriter

"proportionalSansSerif" = _sans

tts:fontSize

Specify a style property that defines the font size. Only the first (vertical) value is used if two are supplied. Percentage values and units are ignored. Support for absolute pixel (for example, 12) and relative style (for example +2) sizes.

tts: fontStyle

Specify a style property that defines the font style.

"normal"

"italic"

"inherit"*

* The default behavior; inherits the style from the enclosing tag.

tts: fontWeight

Specify a style property that defines the font weight.

"normal"

"bold"

"inherit"*

* The default behavior; inherits the style from the enclosing tag.

tts: textAlign

Specify a style property that defines how inline areas are aligned within a containing block area.

"left"

"right"

"center"

"start" (="left")

"end" (="right")

"inherit"*

*Inherits the style from the enclosing tag. If no textAlign tag is set, the default is "left".

tts: wrapOption

Specify a style property that defines whether or not automatic line wrapping (breaking) applies within the context of the affected element. This setting affects all paragraphs in the caption element.

"wrap"

"noWrap"

"inherit"*

*Inherits the style from the enclosing tag. If no wrapOption tag is set, the default is "wrap".

Non Supported Attributes

tts: direction

tts: display

tts: displayAlign

tts: dynamicFlow

tts: extent

tts: lineHeight

tts: opacity

tts: origin

tts: overflow

tts: padding

tts: showBackground

tts: textOutline

tts: unicodeBidi

tts: visibility

tts: writingMode

tts: zIndex

// Ethnio survey code removed