web_sys/features/
gen_DisplayMediaStreamConstraints.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 #[wasm_bindgen(
8 extends = "::js_sys::Object",
9 js_name = "DisplayMediaStreamConstraints"
10 )]
11 #[derive(Debug, Clone, PartialEq, Eq)]
12 #[doc = "The `DisplayMediaStreamConstraints` dictionary."]
13 #[doc = ""]
14 #[doc = "*This API requires the following crate features to be activated: `DisplayMediaStreamConstraints`*"]
15 pub type DisplayMediaStreamConstraints;
16 #[doc = "Get the `audio` field of this object."]
17 #[doc = ""]
18 #[doc = "*This API requires the following crate features to be activated: `DisplayMediaStreamConstraints`*"]
19 #[wasm_bindgen(method, getter = "audio")]
20 pub fn get_audio(this: &DisplayMediaStreamConstraints) -> ::wasm_bindgen::JsValue;
21 #[doc = "Change the `audio` field of this object."]
22 #[doc = ""]
23 #[doc = "*This API requires the following crate features to be activated: `DisplayMediaStreamConstraints`*"]
24 #[wasm_bindgen(method, setter = "audio")]
25 pub fn set_audio(this: &DisplayMediaStreamConstraints, val: &::wasm_bindgen::JsValue);
26 #[doc = "Change the `audio` field of this object."]
27 #[doc = ""]
28 #[doc = "*This API requires the following crate features to be activated: `DisplayMediaStreamConstraints`*"]
29 #[wasm_bindgen(method, setter = "audio")]
30 pub fn set_audio_bool(this: &DisplayMediaStreamConstraints, val: bool);
31 #[cfg(feature = "MediaTrackConstraints")]
32 #[doc = "Change the `audio` field of this object."]
33 #[doc = ""]
34 #[doc = "*This API requires the following crate features to be activated: `DisplayMediaStreamConstraints`, `MediaTrackConstraints`*"]
35 #[wasm_bindgen(method, setter = "audio")]
36 pub fn set_audio_media_track_constraints(
37 this: &DisplayMediaStreamConstraints,
38 val: &MediaTrackConstraints,
39 );
40 #[doc = "Get the `video` field of this object."]
41 #[doc = ""]
42 #[doc = "*This API requires the following crate features to be activated: `DisplayMediaStreamConstraints`*"]
43 #[wasm_bindgen(method, getter = "video")]
44 pub fn get_video(this: &DisplayMediaStreamConstraints) -> ::wasm_bindgen::JsValue;
45 #[doc = "Change the `video` field of this object."]
46 #[doc = ""]
47 #[doc = "*This API requires the following crate features to be activated: `DisplayMediaStreamConstraints`*"]
48 #[wasm_bindgen(method, setter = "video")]
49 pub fn set_video(this: &DisplayMediaStreamConstraints, val: &::wasm_bindgen::JsValue);
50 #[doc = "Change the `video` field of this object."]
51 #[doc = ""]
52 #[doc = "*This API requires the following crate features to be activated: `DisplayMediaStreamConstraints`*"]
53 #[wasm_bindgen(method, setter = "video")]
54 pub fn set_video_bool(this: &DisplayMediaStreamConstraints, val: bool);
55 #[cfg(feature = "MediaTrackConstraints")]
56 #[doc = "Change the `video` field of this object."]
57 #[doc = ""]
58 #[doc = "*This API requires the following crate features to be activated: `DisplayMediaStreamConstraints`, `MediaTrackConstraints`*"]
59 #[wasm_bindgen(method, setter = "video")]
60 pub fn set_video_media_track_constraints(
61 this: &DisplayMediaStreamConstraints,
62 val: &MediaTrackConstraints,
63 );
64}
65impl DisplayMediaStreamConstraints {
66 #[doc = "Construct a new `DisplayMediaStreamConstraints`."]
67 #[doc = ""]
68 #[doc = "*This API requires the following crate features to be activated: `DisplayMediaStreamConstraints`*"]
69 pub fn new() -> Self {
70 #[allow(unused_mut)]
71 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
72 ret
73 }
74 #[deprecated = "Use `set_audio()` instead."]
75 pub fn audio(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
76 self.set_audio(val);
77 self
78 }
79 #[deprecated = "Use `set_video()` instead."]
80 pub fn video(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
81 self.set_video(val);
82 self
83 }
84}
85impl Default for DisplayMediaStreamConstraints {
86 fn default() -> Self {
87 Self::new()
88 }
89}