maxcountryman_web_sys/features/
gen_MediaKeySystemConfiguration.rs

1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[wasm_bindgen]
5extern "C" {
6    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = MediaKeySystemConfiguration)]
7    #[derive(Debug, Clone, PartialEq, Eq)]
8    #[doc = "The `MediaKeySystemConfiguration` dictionary."]
9    #[doc = ""]
10    #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"]
11    pub type MediaKeySystemConfiguration;
12}
13impl MediaKeySystemConfiguration {
14    #[doc = "Construct a new `MediaKeySystemConfiguration`."]
15    #[doc = ""]
16    #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"]
17    pub fn new() -> Self {
18        #[allow(unused_mut)]
19        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
20        ret
21    }
22    #[doc = "Change the `audioCapabilities` field of this object."]
23    #[doc = ""]
24    #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"]
25    pub fn audio_capabilities(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
26        use wasm_bindgen::JsValue;
27        let r = ::js_sys::Reflect::set(
28            self.as_ref(),
29            &JsValue::from("audioCapabilities"),
30            &JsValue::from(val),
31        );
32        debug_assert!(
33            r.is_ok(),
34            "setting properties should never fail on our dictionary objects"
35        );
36        let _ = r;
37        self
38    }
39    #[cfg(feature = "MediaKeysRequirement")]
40    #[doc = "Change the `distinctiveIdentifier` field of this object."]
41    #[doc = ""]
42    #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`, `MediaKeysRequirement`*"]
43    pub fn distinctive_identifier(&mut self, val: MediaKeysRequirement) -> &mut Self {
44        use wasm_bindgen::JsValue;
45        let r = ::js_sys::Reflect::set(
46            self.as_ref(),
47            &JsValue::from("distinctiveIdentifier"),
48            &JsValue::from(val),
49        );
50        debug_assert!(
51            r.is_ok(),
52            "setting properties should never fail on our dictionary objects"
53        );
54        let _ = r;
55        self
56    }
57    #[doc = "Change the `initDataTypes` field of this object."]
58    #[doc = ""]
59    #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"]
60    pub fn init_data_types(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
61        use wasm_bindgen::JsValue;
62        let r = ::js_sys::Reflect::set(
63            self.as_ref(),
64            &JsValue::from("initDataTypes"),
65            &JsValue::from(val),
66        );
67        debug_assert!(
68            r.is_ok(),
69            "setting properties should never fail on our dictionary objects"
70        );
71        let _ = r;
72        self
73    }
74    #[doc = "Change the `label` field of this object."]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"]
77    pub fn label(&mut self, val: &str) -> &mut Self {
78        use wasm_bindgen::JsValue;
79        let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val));
80        debug_assert!(
81            r.is_ok(),
82            "setting properties should never fail on our dictionary objects"
83        );
84        let _ = r;
85        self
86    }
87    #[cfg(feature = "MediaKeysRequirement")]
88    #[doc = "Change the `persistentState` field of this object."]
89    #[doc = ""]
90    #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`, `MediaKeysRequirement`*"]
91    pub fn persistent_state(&mut self, val: MediaKeysRequirement) -> &mut Self {
92        use wasm_bindgen::JsValue;
93        let r = ::js_sys::Reflect::set(
94            self.as_ref(),
95            &JsValue::from("persistentState"),
96            &JsValue::from(val),
97        );
98        debug_assert!(
99            r.is_ok(),
100            "setting properties should never fail on our dictionary objects"
101        );
102        let _ = r;
103        self
104    }
105    #[doc = "Change the `sessionTypes` field of this object."]
106    #[doc = ""]
107    #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"]
108    pub fn session_types(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
109        use wasm_bindgen::JsValue;
110        let r = ::js_sys::Reflect::set(
111            self.as_ref(),
112            &JsValue::from("sessionTypes"),
113            &JsValue::from(val),
114        );
115        debug_assert!(
116            r.is_ok(),
117            "setting properties should never fail on our dictionary objects"
118        );
119        let _ = r;
120        self
121    }
122    #[doc = "Change the `videoCapabilities` field of this object."]
123    #[doc = ""]
124    #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"]
125    pub fn video_capabilities(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
126        use wasm_bindgen::JsValue;
127        let r = ::js_sys::Reflect::set(
128            self.as_ref(),
129            &JsValue::from("videoCapabilities"),
130            &JsValue::from(val),
131        );
132        debug_assert!(
133            r.is_ok(),
134            "setting properties should never fail on our dictionary objects"
135        );
136        let _ = r;
137        self
138    }
139}
140impl Default for MediaKeySystemConfiguration {
141    fn default() -> Self {
142        Self::new()
143    }
144}