2013-03-27 05:32:51 +04:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* The origin of this IDL file is
|
|
|
|
* http://dev.w3.org/2011/webrtc/editor/getusermedia.html
|
|
|
|
*
|
|
|
|
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
|
|
|
* liability, trademark and document use rules apply.
|
|
|
|
*/
|
|
|
|
|
2015-07-29 08:16:19 +03:00
|
|
|
// These two enums are in the spec even though they're not used directly in the
|
|
|
|
// API due to https://www.w3.org/Bugs/Public/show_bug.cgi?id=19936
|
|
|
|
// Their binding code is used in the implementation.
|
|
|
|
|
|
|
|
enum VideoFacingModeEnum {
|
|
|
|
"user",
|
|
|
|
"environment",
|
|
|
|
"left",
|
|
|
|
"right"
|
|
|
|
};
|
|
|
|
|
|
|
|
enum MediaSourceEnum {
|
|
|
|
"camera",
|
|
|
|
"screen",
|
|
|
|
"application",
|
|
|
|
"window",
|
|
|
|
"browser",
|
|
|
|
"microphone",
|
|
|
|
"audioCapture",
|
|
|
|
"other"
|
2015-09-22 05:20:45 +03:00
|
|
|
// If values are added, adjust n_values in Histograms.json (2 places)
|
2015-07-29 08:16:19 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef (long or ConstrainLongRange) ConstrainLong;
|
|
|
|
typedef (double or ConstrainDoubleRange) ConstrainDouble;
|
|
|
|
typedef (boolean or ConstrainBooleanParameters) ConstrainBoolean;
|
|
|
|
typedef (DOMString or sequence<DOMString> or ConstrainDOMStringParameters) ConstrainDOMString;
|
|
|
|
|
2015-09-18 21:03:30 +03:00
|
|
|
// Note: When adding new constraints, remember to update the SelectSettings()
|
|
|
|
// function in MediaManager.cpp to make OverconstrainedError's constraint work!
|
|
|
|
|
2015-07-29 08:16:19 +03:00
|
|
|
dictionary MediaTrackConstraintSet {
|
|
|
|
ConstrainLong width;
|
|
|
|
ConstrainLong height;
|
|
|
|
ConstrainDouble frameRate;
|
|
|
|
ConstrainDOMString facingMode;
|
|
|
|
DOMString mediaSource = "camera";
|
|
|
|
long long browserWindow;
|
|
|
|
boolean scrollWithPage;
|
|
|
|
ConstrainDOMString deviceId;
|
2015-10-23 00:03:47 +03:00
|
|
|
ConstrainLong viewportOffsetX;
|
|
|
|
ConstrainLong viewportOffsetY;
|
|
|
|
ConstrainLong viewportWidth;
|
|
|
|
ConstrainLong viewportHeight;
|
2016-01-23 00:46:38 +03:00
|
|
|
ConstrainBoolean echoCancellation;
|
|
|
|
ConstrainBoolean mozNoiseSuppression;
|
|
|
|
ConstrainBoolean mozAutoGainControl;
|
2015-07-29 08:16:19 +03:00
|
|
|
};
|
|
|
|
|
2014-04-18 22:00:16 +04:00
|
|
|
dictionary MediaTrackConstraints : MediaTrackConstraintSet {
|
|
|
|
sequence<MediaTrackConstraintSet> advanced;
|
2014-04-18 23:14:44 +04:00
|
|
|
};
|
2014-04-18 22:00:16 +04:00
|
|
|
|
2015-09-17 06:09:28 +03:00
|
|
|
[Exposed=Window]
|
|
|
|
interface MediaStreamTrack : EventTarget {
|
2013-03-27 05:32:51 +04:00
|
|
|
readonly attribute DOMString kind;
|
|
|
|
readonly attribute DOMString id;
|
|
|
|
readonly attribute DOMString label;
|
2013-05-30 08:44:43 +04:00
|
|
|
attribute boolean enabled;
|
2015-09-17 06:09:28 +03:00
|
|
|
// readonly attribute boolean muted;
|
|
|
|
// attribute EventHandler onmute;
|
|
|
|
// attribute EventHandler onunmute;
|
|
|
|
// readonly attribute boolean _readonly;
|
|
|
|
// readonly attribute boolean remote;
|
2016-06-14 12:06:51 +03:00
|
|
|
// readonly attribute MediaStreamTrackState readyState;
|
2016-05-10 18:03:29 +03:00
|
|
|
attribute EventHandler onended;
|
2016-01-22 11:27:51 +03:00
|
|
|
MediaStreamTrack clone ();
|
2014-08-27 09:03:49 +04:00
|
|
|
void stop ();
|
2015-09-17 06:09:28 +03:00
|
|
|
// MediaTrackCapabilities getCapabilities ();
|
|
|
|
// MediaTrackConstraints getConstraints ();
|
|
|
|
// MediaTrackSettings getSettings ();
|
|
|
|
|
|
|
|
[Throws]
|
|
|
|
Promise<void> applyConstraints (optional MediaTrackConstraints constraints);
|
|
|
|
// attribute EventHandler onoverconstrained;
|
2013-03-27 05:32:51 +04:00
|
|
|
};
|