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