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/.
6 * The origin of this IDL file is
7 * http://dev.w3.org/2011/webrtc/editor/getusermedia.html
9 * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
10 * liability, trademark and document use rules apply.
13 // These two enums are in the spec even though they're not used directly in the
14 // API due to https://www.w3.org/Bugs/Public/show_bug.cgi?id=19936
15 // Their binding code is used in the implementation.
17 enum VideoFacingModeEnum {
24 enum MediaSourceEnum {
33 // If values are added, adjust n_values in Histograms.json (2 places)
36 dictionary ConstrainLongRange {
43 dictionary ConstrainDoubleRange {
50 dictionary ConstrainBooleanParameters {
55 dictionary ConstrainDOMStringParameters {
56 (DOMString or sequence<DOMString>) exact;
57 (DOMString or sequence<DOMString>) ideal;
60 typedef (long or ConstrainLongRange) ConstrainLong;
61 typedef (double or ConstrainDoubleRange) ConstrainDouble;
62 typedef (boolean or ConstrainBooleanParameters) ConstrainBoolean;
63 typedef (DOMString or sequence<DOMString> or ConstrainDOMStringParameters) ConstrainDOMString;
65 // Note: When adding new constraints, remember to update the SelectSettings()
66 // function in MediaManager.cpp to make OverconstrainedError's constraint work!
68 dictionary MediaTrackConstraintSet {
71 ConstrainDouble frameRate;
72 ConstrainDOMString facingMode;
73 DOMString mediaSource;
74 long long browserWindow;
75 boolean scrollWithPage;
76 ConstrainDOMString deviceId;
77 ConstrainDOMString groupId;
78 ConstrainLong viewportOffsetX;
79 ConstrainLong viewportOffsetY;
80 ConstrainLong viewportWidth;
81 ConstrainLong viewportHeight;
82 ConstrainBoolean echoCancellation;
83 ConstrainBoolean noiseSuppression;
84 ConstrainBoolean autoGainControl;
85 ConstrainLong channelCount;
89 dictionary MediaTrackConstraints : MediaTrackConstraintSet {
90 sequence<MediaTrackConstraintSet> advanced;
93 enum MediaStreamTrackState {
99 interface MediaStreamTrack : EventTarget {
100 readonly attribute DOMString kind;
101 readonly attribute DOMString id;
103 readonly attribute DOMString label;
104 attribute boolean enabled;
105 readonly attribute boolean muted;
106 attribute EventHandler onmute;
107 attribute EventHandler onunmute;
108 readonly attribute MediaStreamTrackState readyState;
109 attribute EventHandler onended;
110 MediaStreamTrack clone ();
112 // MediaTrackCapabilities getCapabilities ();
113 MediaTrackConstraints getConstraints ();
115 MediaTrackSettings getSettings ();
117 [NewObject, NeedsCallerType]
118 Promise<undefined> applyConstraints (optional MediaTrackConstraints constraints = {});
119 // attribute EventHandler onoverconstrained;