1
+ // GENERATED CONTENT - DO NOT EDIT
2
+ // Content of this file was automatically extracted from the Media Capture and Streams spec.
3
+ // See https://w3c.github.io/mediacapture-main/
4
+
1
5
[Exposed=Window,
2
6
Constructor,
3
- Constructor(MediaStream stream),
4
- Constructor(sequence<MediaStreamTrack> tracks)]
7
+ Constructor (MediaStream stream),
8
+ Constructor (sequence<MediaStreamTrack> tracks)]
5
9
interface MediaStream : EventTarget {
6
- readonly attribute DOMString id;
7
- sequence<MediaStreamTrack> getAudioTracks();
8
- sequence<MediaStreamTrack> getVideoTracks();
9
- sequence<MediaStreamTrack> getTracks();
10
- MediaStreamTrack? getTrackById(DOMString trackId);
11
- void addTrack(MediaStreamTrack track);
12
- void removeTrack(MediaStreamTrack track);
13
- MediaStream clone();
14
- readonly attribute boolean active;
15
- attribute EventHandler onaddtrack;
16
- attribute EventHandler onremovetrack;
10
+ readonly attribute DOMString id;
11
+ sequence<MediaStreamTrack> getAudioTracks ();
12
+ sequence<MediaStreamTrack> getVideoTracks ();
13
+ sequence<MediaStreamTrack> getTracks ();
14
+ MediaStreamTrack? getTrackById (DOMString trackId);
15
+ void addTrack (MediaStreamTrack track);
16
+ void removeTrack (MediaStreamTrack track);
17
+ MediaStream clone ();
18
+ readonly attribute boolean active;
19
+ attribute EventHandler onaddtrack;
20
+ attribute EventHandler onremovetrack;
17
21
};
18
22
19
23
[Exposed=Window]
20
24
interface MediaStreamTrack : EventTarget {
21
- readonly attribute DOMString kind;
22
- readonly attribute DOMString id;
23
- readonly attribute DOMString label;
24
- attribute boolean enabled;
25
- readonly attribute boolean muted;
26
- attribute EventHandler onmute;
27
- attribute EventHandler onunmute;
28
- readonly attribute MediaStreamTrackState readyState;
29
- attribute EventHandler onended;
30
- MediaStreamTrack clone();
31
- void stop();
32
- MediaTrackCapabilities getCapabilities();
33
- MediaTrackConstraints getConstraints();
34
- MediaTrackSettings getSettings();
35
- Promise<void> applyConstraints(optional MediaTrackConstraints constraints);
36
- attribute EventHandler onoverconstrained;
25
+ readonly attribute DOMString kind;
26
+ readonly attribute DOMString id;
27
+ readonly attribute DOMString label;
28
+ attribute boolean enabled;
29
+ readonly attribute boolean muted;
30
+ attribute EventHandler onmute;
31
+ attribute EventHandler onunmute;
32
+ readonly attribute MediaStreamTrackState readyState;
33
+ attribute EventHandler onended;
34
+ MediaStreamTrack clone ();
35
+ void stop ();
36
+ MediaTrackCapabilities getCapabilities ();
37
+ MediaTrackConstraints getConstraints ();
38
+ MediaTrackSettings getSettings ();
39
+ Promise<void> applyConstraints (optional MediaTrackConstraints constraints);
40
+ attribute EventHandler onoverconstrained;
37
41
};
38
42
39
43
enum MediaStreamTrackState {
@@ -42,71 +46,83 @@ enum MediaStreamTrackState {
42
46
};
43
47
44
48
dictionary MediaTrackSupportedConstraints {
45
- boolean width = true;
46
- boolean height = true;
47
- boolean aspectRatio = true;
48
- boolean frameRate = true;
49
- boolean facingMode = true;
50
- boolean volume = true;
51
- boolean sampleRate = true;
52
- boolean sampleSize = true;
53
- boolean echoCancellation = true;
54
- boolean latency = true;
55
- boolean channelCount = true;
56
- boolean deviceId = true;
57
- boolean groupId = true;
49
+ boolean width = true;
50
+ boolean height = true;
51
+ boolean aspectRatio = true;
52
+ boolean frameRate = true;
53
+ boolean facingMode = true;
54
+ boolean resizeMode = true;
55
+ boolean volume = true;
56
+ boolean sampleRate = true;
57
+ boolean sampleSize = true;
58
+ boolean echoCancellation = true;
59
+ boolean autoGainControl = true;
60
+ boolean noiseSuppression = true;
61
+ boolean latency = true;
62
+ boolean channelCount = true;
63
+ boolean deviceId = true;
64
+ boolean groupId = true;
58
65
};
59
66
60
67
dictionary MediaTrackCapabilities {
61
- LongRange width;
62
- LongRange height;
63
- DoubleRange aspectRatio;
64
- DoubleRange frameRate;
65
- sequence<DOMString> facingMode;
66
- DoubleRange volume;
67
- LongRange sampleRate;
68
- LongRange sampleSize;
69
- sequence<boolean> echoCancellation;
70
- DoubleRange latency;
71
- LongRange channelCount;
72
- DOMString deviceId;
73
- DOMString groupId;
74
- };
75
-
76
- dictionary MediaTrackConstraints : MediaTrackConstraintSet {
77
- sequence<MediaTrackConstraintSet> advanced;
68
+ ULongRange width;
69
+ ULongRange height;
70
+ DoubleRange aspectRatio;
71
+ DoubleRange frameRate;
72
+ sequence<DOMString> facingMode;
73
+ sequence<DOMString> resizeMode;
74
+ DoubleRange volume;
75
+ ULongRange sampleRate;
76
+ ULongRange sampleSize;
77
+ sequence<boolean> echoCancellation;
78
+ sequence<boolean> autoGainControl;
79
+ sequence<boolean> noiseSuppression;
80
+ DoubleRange latency;
81
+ ULongRange channelCount;
82
+ DOMString deviceId;
83
+ DOMString groupId;
84
+ };
85
+
86
+ dictionary MediaTrackConstraints : MediaTrackConstraintSet {
87
+ sequence<MediaTrackConstraintSet> advanced;
78
88
};
79
89
80
90
dictionary MediaTrackConstraintSet {
81
- ConstrainLong width;
82
- ConstrainLong height;
83
- ConstrainDouble aspectRatio;
84
- ConstrainDouble frameRate;
85
- ConstrainDOMString facingMode;
86
- ConstrainDouble volume;
87
- ConstrainLong sampleRate;
88
- ConstrainLong sampleSize;
89
- ConstrainBoolean echoCancellation;
90
- ConstrainDouble latency;
91
- ConstrainLong channelCount;
92
- ConstrainDOMString deviceId;
93
- ConstrainDOMString groupId;
91
+ ConstrainULong width;
92
+ ConstrainULong height;
93
+ ConstrainDouble aspectRatio;
94
+ ConstrainDouble frameRate;
95
+ ConstrainDOMString facingMode;
96
+ ConstrainDOMString resizeMode;
97
+ ConstrainDouble volume;
98
+ ConstrainULong sampleRate;
99
+ ConstrainULong sampleSize;
100
+ ConstrainBoolean echoCancellation;
101
+ ConstrainBoolean autoGainControl;
102
+ ConstrainBoolean noiseSuppression;
103
+ ConstrainDouble latency;
104
+ ConstrainULong channelCount;
105
+ ConstrainDOMString deviceId;
106
+ ConstrainDOMString groupId;
94
107
};
95
108
96
109
dictionary MediaTrackSettings {
97
- long width;
98
- long height;
99
- double aspectRatio;
100
- double frameRate;
101
- DOMString facingMode;
102
- double volume;
103
- long sampleRate;
104
- long sampleSize;
105
- boolean echoCancellation;
106
- double latency;
107
- long channelCount;
108
- DOMString deviceId;
109
- DOMString groupId;
110
+ long width;
111
+ long height;
112
+ double aspectRatio;
113
+ double frameRate;
114
+ DOMString facingMode;
115
+ DOMString resizeMode;
116
+ double volume;
117
+ long sampleRate;
118
+ long sampleSize;
119
+ boolean echoCancellation;
120
+ boolean autoGainControl;
121
+ boolean noiseSuppression;
122
+ double latency;
123
+ long channelCount;
124
+ DOMString deviceId;
125
+ DOMString groupId;
110
126
};
111
127
112
128
enum VideoFacingModeEnum {
@@ -116,48 +132,52 @@ enum VideoFacingModeEnum {
116
132
"right"
117
133
};
118
134
135
+ enum VideoResizeModeEnum {
136
+ "none",
137
+ "crop-and-scale"
138
+ };
139
+
119
140
[Exposed=Window,
120
- Constructor(DOMString type, MediaStreamTrackEventInit eventInitDict)]
141
+ Constructor (DOMString type, MediaStreamTrackEventInit eventInitDict)]
121
142
interface MediaStreamTrackEvent : Event {
122
143
[SameObject]
123
- readonly attribute MediaStreamTrack track;
144
+ readonly attribute MediaStreamTrack track;
124
145
};
125
146
126
147
dictionary MediaStreamTrackEventInit : EventInit {
127
148
required MediaStreamTrack track;
128
149
};
129
150
130
151
[Exposed=Window,
131
- Constructor(DOMString type, OverconstrainedErrorEventInit eventInitDict)]
152
+ Constructor (DOMString type, OverconstrainedErrorEventInit eventInitDict)]
132
153
interface OverconstrainedErrorEvent : Event {
133
- readonly attribute OverconstrainedError? error;
154
+ readonly attribute OverconstrainedError? error;
134
155
};
135
156
136
157
dictionary OverconstrainedErrorEventInit : EventInit {
137
- OverconstrainedError? error = null;
158
+ OverconstrainedError? error = null;
138
159
};
139
160
140
- [Exposed=Window,
141
- NoInterfaceObject]
161
+ [Exposed=Window, NoInterfaceObject]
142
162
interface NavigatorUserMedia {
143
163
[SameObject]
144
- readonly attribute MediaDevices mediaDevices;
164
+ readonly attribute MediaDevices mediaDevices;
145
165
};
146
166
147
167
Navigator implements NavigatorUserMedia;
148
168
149
169
[Exposed=Window]
150
170
interface MediaDevices : EventTarget {
151
- attribute EventHandler ondevicechange;
152
- Promise<sequence<MediaDeviceInfo>> enumerateDevices();
171
+ attribute EventHandler ondevicechange;
172
+ Promise<sequence<MediaDeviceInfo>> enumerateDevices ();
153
173
};
154
174
155
175
[Exposed=Window]
156
176
interface MediaDeviceInfo {
157
- readonly attribute DOMString deviceId;
158
- readonly attribute MediaDeviceKind kind;
159
- readonly attribute DOMString label;
160
- readonly attribute DOMString groupId;
177
+ readonly attribute DOMString deviceId;
178
+ readonly attribute MediaDeviceKind kind;
179
+ readonly attribute DOMString label;
180
+ readonly attribute DOMString groupId;
161
181
[Default] object toJSON();
162
182
};
163
183
@@ -167,25 +187,22 @@ enum MediaDeviceKind {
167
187
"videoinput"
168
188
};
169
189
170
- [Exposed=Window]
171
- interface InputDeviceInfo : MediaDeviceInfo {
172
- MediaTrackCapabilities getCapabilities();
190
+ [Exposed=Window] interface InputDeviceInfo : MediaDeviceInfo {
191
+ MediaTrackCapabilities getCapabilities ();
173
192
};
174
193
175
194
partial interface NavigatorUserMedia {
176
- void getUserMedia(MediaStreamConstraints constraints,
177
- NavigatorUserMediaSuccessCallback successCallback,
178
- NavigatorUserMediaErrorCallback errorCallback);
195
+ void getUserMedia (MediaStreamConstraints constraints, NavigatorUserMediaSuccessCallback successCallback, NavigatorUserMediaErrorCallback errorCallback);
179
196
};
180
197
181
198
partial interface MediaDevices {
182
- MediaTrackSupportedConstraints getSupportedConstraints();
183
- Promise<MediaStream> getUserMedia(optional MediaStreamConstraints constraints);
199
+ MediaTrackSupportedConstraints getSupportedConstraints ();
200
+ Promise<MediaStream> getUserMedia (optional MediaStreamConstraints constraints);
184
201
};
185
202
186
203
dictionary MediaStreamConstraints {
187
- (boolean or MediaTrackConstraints) video = false;
188
- (boolean or MediaTrackConstraints) audio = false;
204
+ (boolean or MediaTrackConstraints) video = false;
205
+ (boolean or MediaTrackConstraints) audio = false;
189
206
};
190
207
191
208
callback NavigatorUserMediaSuccessCallback = void (MediaStream stream);
@@ -196,44 +213,44 @@ typedef object MediaStreamError;
196
213
197
214
[NoInterfaceObject]
198
215
interface ConstrainablePattern {
199
- Capabilities getCapabilities();
200
- Constraints getConstraints();
201
- Settings getSettings();
202
- Promise<void> applyConstraints(optional Constraints constraints);
203
- attribute EventHandler onoverconstrained;
216
+ Capabilities getCapabilities ();
217
+ Constraints getConstraints ();
218
+ Settings getSettings ();
219
+ Promise<void> applyConstraints (optional Constraints constraints);
220
+ attribute EventHandler onoverconstrained;
204
221
};
205
222
206
223
dictionary DoubleRange {
207
- double max;
208
- double min;
224
+ double max;
225
+ double min;
209
226
};
210
227
211
228
dictionary ConstrainDoubleRange : DoubleRange {
212
- double exact;
213
- double ideal;
229
+ double exact;
230
+ double ideal;
214
231
};
215
232
216
- dictionary LongRange {
217
- long max;
218
- long min;
233
+ dictionary ULongRange {
234
+ [Clamp] unsigned long max;
235
+ [Clamp] unsigned long min;
219
236
};
220
237
221
- dictionary ConstrainLongRange : LongRange {
222
- long exact;
223
- long ideal;
238
+ dictionary ConstrainULongRange : ULongRange {
239
+ [Clamp] unsigned long exact;
240
+ [Clamp] unsigned long ideal;
224
241
};
225
242
226
243
dictionary ConstrainBooleanParameters {
227
- boolean exact;
228
- boolean ideal;
244
+ boolean exact;
245
+ boolean ideal;
229
246
};
230
247
231
248
dictionary ConstrainDOMStringParameters {
232
- (DOMString or sequence<DOMString>) exact;
233
- (DOMString or sequence<DOMString>) ideal;
249
+ (DOMString or sequence<DOMString>) exact;
250
+ (DOMString or sequence<DOMString>) ideal;
234
251
};
235
252
236
- typedef (long or ConstrainLongRange) ConstrainLong ;
253
+ typedef ([Clamp] unsigned long or ConstrainULongRange) ConstrainULong ;
237
254
238
255
typedef (double or ConstrainDoubleRange) ConstrainDouble;
239
256
@@ -251,5 +268,5 @@ dictionary ConstraintSet {
251
268
};
252
269
253
270
dictionary Constraints : ConstraintSet {
254
- sequence<ConstraintSet> advanced;
271
+ sequence<ConstraintSet> advanced;
255
272
};
0 commit comments