1 #![allow(unused_imports)]
2 use super::*;
3 use wasm_bindgen::prelude::*;
4 #[wasm_bindgen]
5 extern "C" {
6     # [wasm_bindgen (extends = :: js_sys :: Object , js_name = MediaDecodingConfiguration)]
7     #[derive(Debug, Clone, PartialEq, Eq)]
8     #[doc = "The `MediaDecodingConfiguration` dictionary."]
9     #[doc = ""]
10     #[doc = "*This API requires the following crate features to be activated: `MediaDecodingConfiguration`*"]
11     pub type MediaDecodingConfiguration;
12 }
13 impl MediaDecodingConfiguration {
14     #[cfg(feature = "MediaDecodingType")]
15     #[doc = "Construct a new `MediaDecodingConfiguration`."]
16     #[doc = ""]
17     #[doc = "*This API requires the following crate features to be activated: `MediaDecodingConfiguration`, `MediaDecodingType`*"]
new(type_: MediaDecodingType) -> Self18     pub fn new(type_: MediaDecodingType) -> Self {
19         #[allow(unused_mut)]
20         let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
21         ret.type_(type_);
22         ret
23     }
24     #[cfg(feature = "AudioConfiguration")]
25     #[doc = "Change the `audio` field of this object."]
26     #[doc = ""]
27     #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`, `MediaDecodingConfiguration`*"]
audio(&mut self, val: &AudioConfiguration) -> &mut Self28     pub fn audio(&mut self, val: &AudioConfiguration) -> &mut Self {
29         use wasm_bindgen::JsValue;
30         let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("audio"), &JsValue::from(val));
31         debug_assert!(
32             r.is_ok(),
33             "setting properties should never fail on our dictionary objects"
34         );
35         let _ = r;
36         self
37     }
38     #[cfg(feature = "VideoConfiguration")]
39     #[doc = "Change the `video` field of this object."]
40     #[doc = ""]
41     #[doc = "*This API requires the following crate features to be activated: `MediaDecodingConfiguration`, `VideoConfiguration`*"]
video(&mut self, val: &VideoConfiguration) -> &mut Self42     pub fn video(&mut self, val: &VideoConfiguration) -> &mut Self {
43         use wasm_bindgen::JsValue;
44         let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("video"), &JsValue::from(val));
45         debug_assert!(
46             r.is_ok(),
47             "setting properties should never fail on our dictionary objects"
48         );
49         let _ = r;
50         self
51     }
52     #[cfg(feature = "MediaDecodingType")]
53     #[doc = "Change the `type` field of this object."]
54     #[doc = ""]
55     #[doc = "*This API requires the following crate features to be activated: `MediaDecodingConfiguration`, `MediaDecodingType`*"]
type_(&mut self, val: MediaDecodingType) -> &mut Self56     pub fn type_(&mut self, val: MediaDecodingType) -> &mut Self {
57         use wasm_bindgen::JsValue;
58         let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val));
59         debug_assert!(
60             r.is_ok(),
61             "setting properties should never fail on our dictionary objects"
62         );
63         let _ = r;
64         self
65     }
66 }
67