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/mediarecorder/stop/index.html | 76 ++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 files/ja/web/api/mediarecorder/stop/index.html (limited to 'files/ja/web/api/mediarecorder/stop/index.html') diff --git a/files/ja/web/api/mediarecorder/stop/index.html b/files/ja/web/api/mediarecorder/stop/index.html new file mode 100644 index 0000000000..2b2fea74b4 --- /dev/null +++ b/files/ja/web/api/mediarecorder/stop/index.html @@ -0,0 +1,76 @@ +--- +title: MediaRecorder.stop() +slug: Web/API/MediaRecorder/stop +tags: + - API + - Media Capture + - Media Recorder API + - MediaRecorder + - Method + - Reference + - stop +translation_of: Web/API/MediaRecorder/stop +--- +
{{APIRef("MediaStream Recording")}}
+ +

MediaRecorder.stop() メソッド(MediaStream Recording API の一部)は、メディアキャプチャを停止するために使用します。

+ +

stop() メソッドを呼び出すと、UA は次の手順を実行するタスクをキューに入れます。

+ +
    +
  1. {{domxref("MediaRecorder.state")}} が "inactive" の場合は、DOM の InvalidState エラーを発生させてこれらの手順を終了します。 {{domxref("MediaRecorder.state")}} が "inactive" でない場合は、次の手順に進みます。
  2. +
  3. {{domxref("MediaRecorder.state")}} を "inactive" に設定してメディアのキャプチャを停止します。
  4. +
  5. 収集されたデータの Blob を含む dataavailable イベントを発生させます。
  6. +
  7. stop イベントを発生させます。
  8. +
+ +

構文

+ +
 MediaRecorder.stop()
+ +

エラー

+ +

MediaRecorder オブジェクトの {{domxref("MediaRecorder.state")}} が "inactive" のときに stop() メソッドが呼び出されると、InvalidState エラーが発生します — メディアキャプチャが既に停止している場合は停止しても意味がありません。

+ +

+ +
...
+
+  stop.onclick = function() {
+    mediaRecorder.stop();
+    console.log("レコーダー停止、データ使用可能");
+  }
+
+...
+ +

仕様

+ + + + + + + + + + + + + + +
仕様状態コメント
{{SpecName("MediaStream Recording", "#widl-MediaRecorder-stop-void", "MediaRecorder.stop()")}}{{Spec2("MediaStream Recording")}}初期定義
+ +

ブラウザーの互換性

+ + + +

{{Compat("api.MediaRecorder.stop")}}

+ +

関連情報

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