使用 Timed Text 註解

FLVPlaybackCaptioning 組件會下載 Timed Text (TT) XML 檔,為相關的 FLVPlayback 組件啟用註解功能。如需有關 Timed Text 格式的詳細資訊,請參閱 www.w3.org 上的音效視訊 Timed Text 資訊。

本節概要說明支援的 Timed Text 標籤 (必要的註解功能檔標籤) 並提供一個 Timed Text XML 檔的範例。如需有關所有支援之 Timed Text 標籤的詳細資訊,請參閱 Timed Text 標籤

FLVPlaybackCaptioning 組件支援下列 Timed Text 標籤:

類別

工作

段落格式支援

將段落靠右、靠左或置中對齊

文字格式支援

  • 以絕對像素大小或 delta 樣式 (例如:+2、-4) 設定文字的大小

  • 設定文字顏色和字體

  • 設定文字為粗體和斜體

  • 設定文字齊行

其它格式支援

  • 為註解設定 TextField 的背景顏色

  • 為註解將 TextField 的背景顏色設定為透明 (Alpha 0)

  • 為註解設定 TextField 的文字換行功能 (啟用或停用)

FLVPlaybackCaptioning 組件符合 FLV 檔的時間碼。每個註解都必須具有一個 begin 特質,用來決定註解應該出現的時間。如果註解沒有 dur end 特質,當下一個註解出現或 FLV 檔結束時,註解就會消失。

下列為 Timed Text XML 檔的範例。這個檔案 (caption_video.xml) 將為 caption_video.flv 檔案提供註解功能。您可以在 www.helpexamples.com/flash/video/caption_video.flv 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 標籤

FLVPlaybackCaptioning 組件支援註解功能 XML 檔的 Timed Text 標籤。如需有關音效視訊 Timed Text 標籤的詳細資訊,請參閱 www.w3.org 上的資訊。下表列出支援和不支援的標籤。

函數

標籤/值

用途/說明

範例

忽略的標籤

metadata

忽略 / 允許於任何文件層級

set

忽略 / 允許於任何文件層級

xml:lang

忽略

xml:space

忽略 / 行為指令會覆寫至:

xml:space="default"

layout

忽略 / 包括配置標籤區段中的任何區域標籤

br 標籤

所有的特質和內容都會被忽略。

註解的媒體時間

begin 特質

只在 p 標籤中允許。註解媒體時間部署之必要項目。

<p begin="3s">

dur 特質

只在 p 標籤中允許。建議使用。如果未包括,註解會隨 FLV 檔結束或在另一個註解開始時結束。

end 特質

只在 p 標籤中允許。建議使用。如果未包括,註解會隨 FLV 檔結束或在另一個註解開始時結束。

註解的時鐘時間

00:03:00.1

完整時鐘格式

03:00.1

部分時鐘格式

10

不使用單位的偏移時間。偏移表示秒數。

00:03:00:05

00:03:00:05.1

30f

30t

不支援。不支援包括影格或刻度的時間格式。

主體標籤

body

必要項目 / 只支援一個 body 標籤。

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

內容標籤

div 標籤

允許零個以上。使用第一個標籤。

p 標籤

允許零個以上。

span 標籤

一連串文字內容單位的邏輯容器。不支援巢狀範圍。支援特質樣式標籤。

br 標籤

表示明確的斷行符號。

樣式標籤

(所有樣式標籤都用於 p 標籤內)

style

參考一個或多個樣式元素。可以做為標籤和特質使用。做為標籤時,ID 特質為必要項目 (樣式可以重複使用於文件)。支援在樣式標籤內部使用一個或多個樣式標籤。

tts:background Color

指定定義區域背景顏色的樣式屬性。除設定為零 (Alpha 0) 使背景透明外,一律忽略 Alpha。顏色格式為 #RRGGBBAA。

tts:color

指定定義前景顏色的樣式屬性。任何顏色都不支援 Alpha。 transparent 值將轉譯為黑色。

<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

指定定義字體系列的樣式屬性。

"default" = _serif

"monospace" = _typewriter

"sansSerif" = _sans

"serif" = _serif

"monospaceSansSerif" = _typewriter

"monospaceSerif" = _typewriter

"proportionalSansSerif" = _sans

tts:fontSize

指定定義字體大小的樣式屬性。如果提供兩個值,則只會使用第一個 (垂直) 值。忽略百分比值和單位。支援絕對像素 (例如 12) 和相對樣式 (例如 +2) 大小。

tts:fontStyle

指定定義字體樣式的樣式屬性。

"normal"

"italic"

"inherit"*

* 預設行為;繼承封閉標籤的樣式。

tts:fontWeight

指定定義字體寬度的樣式屬性。

"normal"

"bold"

"inherit"*

* 預設行為;繼承封閉標籤的樣式。

tts:textAlign

指定定義容器區塊區域內行內區域對齊方式的樣式屬性。

"left"

"right"

"center"

"start" (="left")

"end" (="right")

"inherit"*

* 繼承封閉標籤的樣式。如果沒有設定 textAlign 標籤,預設為使用 "left"。

tts:wrapOption

指定定義受影響元素之內容內是否套用自動換行 (斷行) 的樣式屬性。這項設定會影響註解元素中的所有段落。

"wrap"

"noWrap"

"inherit"*

* 繼承封閉標籤的樣式。如果沒有設定 wrapOption 標籤,預設為使用 "wrap"。

不支援的特質

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