From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/api/vttcue/index.html | 84 +++++++++++++++++++++++++++++++ files/ja/web/api/vttcue/vttcue/index.html | 56 +++++++++++++++++++++ 2 files changed, 140 insertions(+) create mode 100644 files/ja/web/api/vttcue/index.html create mode 100644 files/ja/web/api/vttcue/vttcue/index.html (limited to 'files/ja/web/api/vttcue') diff --git a/files/ja/web/api/vttcue/index.html b/files/ja/web/api/vttcue/index.html new file mode 100644 index 0000000000..51281adab8 --- /dev/null +++ b/files/ja/web/api/vttcue/index.html @@ -0,0 +1,84 @@ +--- +title: VTTCue +slug: Web/API/VTTCue +tags: + - VTTCue + - WebVTT + - text track + - vtt +translation_of: Web/API/VTTCue +--- +

{{APIRef("WebVTT")}}
+ WebVTT(メディアプレゼンテーションに関するテキストトラック)を処理するための API の一部である VTTCue インターフェイスは、特定の {{HTMLElement("track")}} 要素に関連付けられたテキストトラックを記述および制御します。

+ +

コンストラクタ

+ +
+
{{domxref("VTTCue.VTTCue", "VTTCue(startTime, endTime, text)")}}
+
指定された時間範囲をカバーし、指定されたテキストを持つ、新しく作成された VTTCue オブジェクトを返します。
+
+ +

プロパティ

+ +

このインターフェイスは {{domxref("TextTrackCue")}} からもプロパティを継承しています。

+ +
+
{{domxref("VTTCue.region")}}
+
キューが描画される動画のサブ領域を説明する {{domxref("VTTRegion")}} オブジェクト。 割り当てられていない場合は null
+
{{domxref("VTTCue.vertical")}}
+
キューの書き込み方向を表す列挙型を返します。
+
{{domxref("VTTCue.snapToLines")}}
+
{{domxref("VTTCue.line")}} 属性が整数の行数または動画サイズのパーセントである場合、true を返します。
+
{{domxref("VTTCue.line")}}
+
キューの行位置を返します。 これは、文字列 auto またはその解釈が {{domxref("VTTCue.snapToLines")}} の値に依存する数値になります。
+
{{domxref("VTTCue.lineAlign")}}
+
{{domxref("VTTCue.line")}} の配置を表す列挙型を返します。
+
{{domxref("VTTCue.position")}}
+
行内のキューのインデントを返します。 これは、文字列 auto または {{domxref("VTTCue.region")}} のパーセントを表す数値、または {{domxref("VTTCue.region")}} が null の場合は動画サイズです。
+
{{domxref("VTTCue.positionAlign")}}
+
キューの配置を表す列挙型を返します。 これは {{domxref("VTTCue.position")}} が何に固定されているかを決定するために使用されます。
+
{{domxref("VTTCue.size")}}
+
キューのサイズを表す double 型を動画サイズのパーセントで返します。
+
{{domxref("VTTCue.textAlign")}}
+
キューボックス内のすべてのテキスト行の配置を表す列挙型を返します。
+
{{domxref("VTTCue.text")}}
+
キューの内容を含む {{domxref("DOMString")}} を返します。
+
+ +

メソッド

+ +
+
{{domxref("VTTCue.getCueAsHTML")}}
+
キューのテキストを {{domxref("DocumentFragment")}} として返します。
+
+ +

+ +
var cue = new VTTCue(2, 3, 'かっこいい文章を表示する');
+var tracks = document.querySelector('video').textTracks;
+tracks[0].addCue(cue);
+ +

新しいキューを作成したら、それを {{domxref("TextTrack")}} に追加する必要があります。 追加すると、このキューを2秒から3秒の間に描画し、「かっこいい文章を表示する」というテキストを表示します。

+ +

仕様

+ + + + + + + + + + + + + + +
仕様状態コメント
{{SpecName("WebVTT")}}{{Spec2("WebVTT")}} 
+ +

ブラウザーの互換性

+ + + +

{{Compat("api.VTTCue")}}

diff --git a/files/ja/web/api/vttcue/vttcue/index.html b/files/ja/web/api/vttcue/vttcue/index.html new file mode 100644 index 0000000000..8490cc1c6c --- /dev/null +++ b/files/ja/web/api/vttcue/vttcue/index.html @@ -0,0 +1,56 @@ +--- +title: VTTCue() +slug: Web/API/VTTCue/VTTCue +tags: + - API + - Constructor + - VTTCue + - WebVTT +translation_of: Web/API/VTTCue/VTTCue +--- +

{{APIRef("WebVTT")}}

+ +

VTTCue() コンストラクタは新しい {{domxref("VTTCue")}} オブジェクトを返します。

+ +

構文

+ +
 vttCue = new VTTCue(startTime, endTime, text);
+ +

パラメーター

+ +
+
startTime
+
これは、キューを表示し始める動画の時間を表す double 型です。
+
endTime
+
これは、キューを表示しなくなる動画の時間を表す double 型です。
+
text
+
これは表示するテキストを表す {{domxref("DOMString")}} です。
+
+ +

+ +
// 2から3秒の間に表示するキューを作成し、指定されたテキストを使用します。
+var cue = new VTTCue(2, 3, 'かっこいい文章を表示する');
+ +

仕様

+ + + + + + + + + + + + + + +
仕様状態コメント
{{SpecName("WebVTT", "#dom-vttcue-vttcue", "VTTCue()")}}{{Spec2("WebVTT")}} 
+ +

ブラウザーの互換性

+ + + +

{{Compat("api.VTTCue.VTTCue")}}

-- cgit v1.2.3-54-g00ecf