1/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
5 *
6 * The origin of this IDL file is
7 * https://dvcs.w3.org/hg/dap/raw-file/default/media-stream-capture/MediaRecorder.html
8 *
9 * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
10 * liability, trademark and document use rules apply.
11 */
12
13enum RecordingState { "inactive", "recording", "paused" };
14
15[Exposed=Window]
16interface MediaRecorder : EventTarget {
17  [Throws]
18  constructor(MediaStream stream, optional MediaRecorderOptions options = {});
19  [Throws]
20  constructor(AudioNode node, optional unsigned long output = 0,
21              optional MediaRecorderOptions options = {});
22  readonly attribute MediaStream stream;
23  readonly attribute DOMString mimeType;
24  readonly attribute RecordingState state;
25  attribute EventHandler onstart;
26  attribute EventHandler onstop;
27  attribute EventHandler ondataavailable;
28  attribute EventHandler onpause;
29  attribute EventHandler onresume;
30  attribute EventHandler onerror;
31  readonly attribute unsigned long videoBitsPerSecond;
32  readonly attribute unsigned long audioBitsPerSecond;
33
34
35  [Throws]
36  void start(optional unsigned long timeslice);
37  [Throws]
38  void stop();
39  [Throws]
40  void pause();
41  [Throws]
42  void resume();
43  [Throws]
44  void requestData();
45
46  static boolean isTypeSupported(DOMString type);
47};
48
49dictionary MediaRecorderOptions {
50  DOMString mimeType = "";
51  unsigned long audioBitsPerSecond;
52  unsigned long videoBitsPerSecond;
53  unsigned long bitsPerSecond;
54};
55