From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../api/sourcebuffer/appendbufferasync/index.html | 87 ++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 files/ja/web/api/sourcebuffer/appendbufferasync/index.html (limited to 'files/ja/web/api/sourcebuffer/appendbufferasync') diff --git a/files/ja/web/api/sourcebuffer/appendbufferasync/index.html b/files/ja/web/api/sourcebuffer/appendbufferasync/index.html new file mode 100644 index 0000000000..a1032f53b0 --- /dev/null +++ b/files/ja/web/api/sourcebuffer/appendbufferasync/index.html @@ -0,0 +1,87 @@ +--- +title: SourceBuffer.appendBufferAsync() +slug: Web/API/SourceBuffer/appendBufferAsync +tags: + - API + - Audio + - Experimental + - MSE + - Media + - Media Source Extensions + - Method + - Non-standard + - Reference + - SourceBuffer + - Video + - appendBufferAsync +translation_of: Web/API/SourceBuffer/appendBufferAsync +--- +
{{APIRef("Media Source Extensions")}}{{non-standard_header}}{{SeeCompatTable}}
+ +

{{domxref("SourceBuffer")}} インターフェイスの appendBufferAsync() メソッドは、{{jsxref("ArrayBuffer")}} または {{domxref("ArrayBufferView")}} オブジェクトから SourceBuffer にメディアセグメントデータを非同期的に追加するプロセスを開始します。 バッファが追加されると満たされる {{jsxref("Promise")}} を返します。

+ +

構文

+ +
appendPromise = sourceBuffer.appendBufferAsync(source);
+ +

パラメーター

+ +
+
source
+
SourceBuffer に追加するメディアセグメントデータを含む {{domxref("BufferSource")}}(つまり、{{domxref("ArrayBufferView")}} または {{jsxref("ArrayBuffer")}})。
+
+ +

戻り値

+ +

バッファが SourceBuffer に正常に追加されたときに満たされる {{jsxref("Promise")}}、または要求を開始できなかった場合は null

+ +

+ +

この単純化された非同期関数の例 fillSourceBuffer() は、入力パラメーターとして {{domxref("BufferSource")}} の buffer、およびバッファからソースメディアを追加する SourceBuffer を受け取ります。

+ +
async function fillSourceBuffer(buffer, msBuffer) {
+  try {
+    while(true) {
+      await msBuffer.appendBufferAsync(buffer);
+    }
+  } catch(e) {
+    handleException(e);
+  }
+}
+
+ +

仕様

+ +

現在、仕様の一部ではありません。 これは、Web Platform Incubator Community Group(WICG)の後援の下で実験されています。

+ + + + + + + + + + + + + + +
仕様状態コメント
{{SpecName('Media Source Extensions')}}{{Spec2('Media Source Extensions')}}初期定義、このメソッドは含まれません。
+ +

ブラウザーの互換性

+ +
+ + +

{{Compat("api.SourceBuffer.appendBufferAsync")}}

+
+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf