Implement MediaDevices.enumerateDevices()

This commit is contained in:
Fernando Jiménez Moreno 2020-07-02 17:35:51 +02:00
parent 9f26be6ac0
commit c0fb6c8d23
6 changed files with 159 additions and 14 deletions

View file

@ -0,0 +1,21 @@
/* 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 https://mozilla.org/MPL/2.0/. */
// https://w3c.github.io/mediacapture-main/#device-info
[Exposed=Window,
SecureContext, Pref="dom.webrtc.enabled"]
interface MediaDeviceInfo {
readonly attribute DOMString deviceId;
readonly attribute MediaDeviceKind kind;
readonly attribute DOMString label;
readonly attribute DOMString groupId;
[Default] object toJSON();
};
enum MediaDeviceKind {
"audioinput",
"audiooutput",
"videoinput"
};

View file

@ -8,7 +8,7 @@
SecureContext, Pref="dom.webrtc.enabled"]
interface MediaDevices : EventTarget {
// attribute EventHandler ondevicechange;
// Promise<sequence<MediaDeviceInfo>> enumerateDevices();
Promise<sequence<MediaDeviceInfo>> enumerateDevices();
};
partial interface Navigator {