Skip to main content

web_sys/features/
gen_MediaStreamConstraints.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = MediaStreamConstraints)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `MediaStreamConstraints` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"]
12    pub type MediaStreamConstraints;
13    #[doc = "Get the `audio` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"]
16    #[wasm_bindgen(method, getter = "audio")]
17    pub fn get_audio(this: &MediaStreamConstraints) -> ::wasm_bindgen::JsValue;
18    #[doc = "Change the `audio` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"]
21    #[wasm_bindgen(method, setter = "audio")]
22    pub fn set_audio(this: &MediaStreamConstraints, val: &::wasm_bindgen::JsValue);
23    #[doc = "Change the `audio` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"]
26    #[wasm_bindgen(method, setter = "audio")]
27    pub fn set_audio_bool(this: &MediaStreamConstraints, val: bool);
28    #[cfg(feature = "MediaTrackConstraints")]
29    #[doc = "Change the `audio` field of this object."]
30    #[doc = ""]
31    #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"]
32    #[wasm_bindgen(method, setter = "audio")]
33    pub fn set_audio_media_track_constraints(
34        this: &MediaStreamConstraints,
35        val: &MediaTrackConstraints,
36    );
37    #[doc = "Get the `fake` field of this object."]
38    #[doc = ""]
39    #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"]
40    #[wasm_bindgen(method, getter = "fake")]
41    pub fn get_fake(this: &MediaStreamConstraints) -> Option<bool>;
42    #[doc = "Change the `fake` field of this object."]
43    #[doc = ""]
44    #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"]
45    #[wasm_bindgen(method, setter = "fake")]
46    pub fn set_fake(this: &MediaStreamConstraints, val: bool);
47    #[doc = "Get the `peerIdentity` field of this object."]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"]
50    #[wasm_bindgen(method, getter = "peerIdentity")]
51    pub fn get_peer_identity(this: &MediaStreamConstraints) -> Option<::alloc::string::String>;
52    #[doc = "Change the `peerIdentity` field of this object."]
53    #[doc = ""]
54    #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"]
55    #[wasm_bindgen(method, setter = "peerIdentity")]
56    pub fn set_peer_identity(this: &MediaStreamConstraints, val: Option<&str>);
57    #[doc = "Get the `picture` field of this object."]
58    #[doc = ""]
59    #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"]
60    #[wasm_bindgen(method, getter = "picture")]
61    pub fn get_picture(this: &MediaStreamConstraints) -> Option<bool>;
62    #[doc = "Change the `picture` field of this object."]
63    #[doc = ""]
64    #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"]
65    #[wasm_bindgen(method, setter = "picture")]
66    pub fn set_picture(this: &MediaStreamConstraints, val: bool);
67    #[doc = "Get the `video` field of this object."]
68    #[doc = ""]
69    #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"]
70    #[wasm_bindgen(method, getter = "video")]
71    pub fn get_video(this: &MediaStreamConstraints) -> ::wasm_bindgen::JsValue;
72    #[doc = "Change the `video` field of this object."]
73    #[doc = ""]
74    #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"]
75    #[wasm_bindgen(method, setter = "video")]
76    pub fn set_video(this: &MediaStreamConstraints, val: &::wasm_bindgen::JsValue);
77    #[doc = "Change the `video` field of this object."]
78    #[doc = ""]
79    #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"]
80    #[wasm_bindgen(method, setter = "video")]
81    pub fn set_video_bool(this: &MediaStreamConstraints, val: bool);
82    #[cfg(feature = "MediaTrackConstraints")]
83    #[doc = "Change the `video` field of this object."]
84    #[doc = ""]
85    #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"]
86    #[wasm_bindgen(method, setter = "video")]
87    pub fn set_video_media_track_constraints(
88        this: &MediaStreamConstraints,
89        val: &MediaTrackConstraints,
90    );
91}
92impl MediaStreamConstraints {
93    #[doc = "Construct a new `MediaStreamConstraints`."]
94    #[doc = ""]
95    #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"]
96    pub fn new() -> Self {
97        #[allow(unused_mut)]
98        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
99        ret
100    }
101    #[deprecated = "Use `set_audio()` instead."]
102    pub fn audio(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
103        self.set_audio(val);
104        self
105    }
106    #[deprecated = "Use `set_fake()` instead."]
107    pub fn fake(&mut self, val: bool) -> &mut Self {
108        self.set_fake(val);
109        self
110    }
111    #[deprecated = "Use `set_peer_identity()` instead."]
112    pub fn peer_identity(&mut self, val: Option<&str>) -> &mut Self {
113        self.set_peer_identity(val);
114        self
115    }
116    #[deprecated = "Use `set_picture()` instead."]
117    pub fn picture(&mut self, val: bool) -> &mut Self {
118        self.set_picture(val);
119        self
120    }
121    #[deprecated = "Use `set_video()` instead."]
122    pub fn video(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
123        self.set_video(val);
124        self
125    }
126}
127impl Default for MediaStreamConstraints {
128    fn default() -> Self {
129        Self::new()
130    }
131}