maxcountryman_web_sys/features/
gen_RequestMediaKeySystemAccessNotification.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 = RequestMediaKeySystemAccessNotification)]
7    #[derive(Debug, Clone, PartialEq, Eq)]
8    #[doc = "The `RequestMediaKeySystemAccessNotification` dictionary."]
9    #[doc = ""]
10    #[doc = "*This API requires the following crate features to be activated: `RequestMediaKeySystemAccessNotification`*"]
11    pub type RequestMediaKeySystemAccessNotification;
12}
13impl RequestMediaKeySystemAccessNotification {
14    #[cfg(feature = "MediaKeySystemStatus")]
15    #[doc = "Construct a new `RequestMediaKeySystemAccessNotification`."]
16    #[doc = ""]
17    #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemStatus`, `RequestMediaKeySystemAccessNotification`*"]
18    pub fn new(key_system: &str, status: MediaKeySystemStatus) -> Self {
19        #[allow(unused_mut)]
20        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
21        ret.key_system(key_system);
22        ret.status(status);
23        ret
24    }
25    #[doc = "Change the `keySystem` field of this object."]
26    #[doc = ""]
27    #[doc = "*This API requires the following crate features to be activated: `RequestMediaKeySystemAccessNotification`*"]
28    pub fn key_system(&mut self, val: &str) -> &mut Self {
29        use wasm_bindgen::JsValue;
30        let r = ::js_sys::Reflect::set(
31            self.as_ref(),
32            &JsValue::from("keySystem"),
33            &JsValue::from(val),
34        );
35        debug_assert!(
36            r.is_ok(),
37            "setting properties should never fail on our dictionary objects"
38        );
39        let _ = r;
40        self
41    }
42    #[cfg(feature = "MediaKeySystemStatus")]
43    #[doc = "Change the `status` field of this object."]
44    #[doc = ""]
45    #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemStatus`, `RequestMediaKeySystemAccessNotification`*"]
46    pub fn status(&mut self, val: MediaKeySystemStatus) -> &mut Self {
47        use wasm_bindgen::JsValue;
48        let r =
49            ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("status"), &JsValue::from(val));
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}