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