web_sys/features/
gen_MediaDevices.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 #[wasm_bindgen(
8 extends = "EventTarget",
9 extends = "::js_sys::Object",
10 js_name = "MediaDevices",
11 typescript_type = "MediaDevices"
12 )]
13 #[derive(Debug, Clone, PartialEq, Eq)]
14 #[doc = "The `MediaDevices` class."]
15 #[doc = ""]
16 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices)"]
17 #[doc = ""]
18 #[doc = "*This API requires the following crate features to be activated: `MediaDevices`*"]
19 pub type MediaDevices;
20 #[wasm_bindgen(method, getter, js_class = "MediaDevices", js_name = "ondevicechange")]
21 #[doc = "Getter for the `ondevicechange` field of this object."]
22 #[doc = ""]
23 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/ondevicechange)"]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `MediaDevices`*"]
26 pub fn ondevicechange(this: &MediaDevices) -> Option<::js_sys::Function>;
27 #[wasm_bindgen(method, setter, js_class = "MediaDevices", js_name = "ondevicechange")]
28 #[doc = "Setter for the `ondevicechange` field of this object."]
29 #[doc = ""]
30 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/ondevicechange)"]
31 #[doc = ""]
32 #[doc = "*This API requires the following crate features to be activated: `MediaDevices`*"]
33 pub fn set_ondevicechange(this: &MediaDevices, value: Option<&::js_sys::Function>);
34 #[wasm_bindgen(catch, method, js_class = "MediaDevices", js_name = "enumerateDevices")]
35 #[doc = "The `enumerateDevices()` method."]
36 #[doc = ""]
37 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/enumerateDevices)"]
38 #[doc = ""]
39 #[doc = "*This API requires the following crate features to be activated: `MediaDevices`*"]
40 pub fn enumerate_devices(this: &MediaDevices) -> Result<::js_sys::Promise, JsValue>;
41 #[wasm_bindgen(catch, method, js_class = "MediaDevices", js_name = "getDisplayMedia")]
42 #[doc = "The `getDisplayMedia()` method."]
43 #[doc = ""]
44 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia)"]
45 #[doc = ""]
46 #[doc = "*This API requires the following crate features to be activated: `MediaDevices`*"]
47 pub fn get_display_media(this: &MediaDevices) -> Result<::js_sys::Promise, JsValue>;
48 #[cfg(feature = "DisplayMediaStreamConstraints")]
49 #[wasm_bindgen(catch, method, js_class = "MediaDevices", js_name = "getDisplayMedia")]
50 #[doc = "The `getDisplayMedia()` method."]
51 #[doc = ""]
52 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia)"]
53 #[doc = ""]
54 #[doc = "*This API requires the following crate features to be activated: `DisplayMediaStreamConstraints`, `MediaDevices`*"]
55 pub fn get_display_media_with_constraints(
56 this: &MediaDevices,
57 constraints: &DisplayMediaStreamConstraints,
58 ) -> Result<::js_sys::Promise, JsValue>;
59 #[cfg(feature = "MediaTrackSupportedConstraints")]
60 #[wasm_bindgen(method, js_class = "MediaDevices", js_name = "getSupportedConstraints")]
61 #[doc = "The `getSupportedConstraints()` method."]
62 #[doc = ""]
63 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getSupportedConstraints)"]
64 #[doc = ""]
65 #[doc = "*This API requires the following crate features to be activated: `MediaDevices`, `MediaTrackSupportedConstraints`*"]
66 pub fn get_supported_constraints(this: &MediaDevices) -> MediaTrackSupportedConstraints;
67 #[wasm_bindgen(catch, method, js_class = "MediaDevices", js_name = "getUserMedia")]
68 #[doc = "The `getUserMedia()` method."]
69 #[doc = ""]
70 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia)"]
71 #[doc = ""]
72 #[doc = "*This API requires the following crate features to be activated: `MediaDevices`*"]
73 pub fn get_user_media(this: &MediaDevices) -> Result<::js_sys::Promise, JsValue>;
74 #[cfg(feature = "MediaStreamConstraints")]
75 #[wasm_bindgen(catch, method, js_class = "MediaDevices", js_name = "getUserMedia")]
76 #[doc = "The `getUserMedia()` method."]
77 #[doc = ""]
78 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia)"]
79 #[doc = ""]
80 #[doc = "*This API requires the following crate features to be activated: `MediaDevices`, `MediaStreamConstraints`*"]
81 pub fn get_user_media_with_constraints(
82 this: &MediaDevices,
83 constraints: &MediaStreamConstraints,
84 ) -> Result<::js_sys::Promise, JsValue>;
85}