Bug 1885602 - Part 5: Implement navigating to the SUMO help topic from the menu heade...
[gecko.git] / dom / webidl / MediaStreamTrack.webidl
blobafd2f925f7454233de7b055d276ecfec5c7db2be
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  * http://dev.w3.org/2011/webrtc/editor/getusermedia.html
8  *
9  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
10  * liability, trademark and document use rules apply.
11  */
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 {
18     "user",
19     "environment",
20     "left",
21     "right"
24 enum MediaSourceEnum {
25     "camera",
26     "screen",
27     "application",
28     "window",
29     "browser",
30     "microphone",
31     "audioCapture",
32     "other"
33     // If values are added, adjust n_values in Histograms.json (2 places)
36 dictionary ConstrainLongRange {
37     long min;
38     long max;
39     long exact;
40     long ideal;
43 dictionary ConstrainDoubleRange {
44     double min;
45     double max;
46     double exact;
47     double ideal;
50 dictionary ConstrainBooleanParameters {
51     boolean exact;
52     boolean ideal;
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 {
69     ConstrainLong width;
70     ConstrainLong height;
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;
88 [GenerateToJSON]
89 dictionary MediaTrackConstraints : MediaTrackConstraintSet {
90     sequence<MediaTrackConstraintSet> advanced;
93 enum MediaStreamTrackState {
94     "live",
95     "ended"
98 [Exposed=Window]
99 interface MediaStreamTrack : EventTarget {
100     readonly    attribute DOMString             kind;
101     readonly    attribute DOMString             id;
102     [NeedsCallerType]
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 ();
111     undefined              stop ();
112 //  MediaTrackCapabilities getCapabilities ();
113     MediaTrackConstraints  getConstraints ();
114     [NeedsCallerType]
115     MediaTrackSettings     getSettings ();
117     [NewObject, NeedsCallerType]
118     Promise<undefined>     applyConstraints (optional MediaTrackConstraints constraints = {});
119 //              attribute EventHandler          onoverconstrained;