mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Implement MediaDevices.enumerateDevices()
This commit is contained in:
parent
9f26be6ac0
commit
c0fb6c8d23
6 changed files with 159 additions and 14 deletions
21
components/script/dom/webidls/MediaDeviceInfo.webidl
Normal file
21
components/script/dom/webidls/MediaDeviceInfo.webidl
Normal 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"
|
||||
};
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue