web_sys/features/
gen_MediaDecodingConfiguration.rs1#![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 = MediaDecodingConfiguration)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `MediaDecodingConfiguration` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `MediaDecodingConfiguration`*"]
12 pub type MediaDecodingConfiguration;
13 #[cfg(feature = "AudioConfiguration")]
14 #[doc = "Get the `audio` field of this object."]
15 #[doc = ""]
16 #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`, `MediaDecodingConfiguration`*"]
17 #[wasm_bindgen(method, getter = "audio")]
18 pub fn get_audio(this: &MediaDecodingConfiguration) -> Option<AudioConfiguration>;
19 #[cfg(feature = "AudioConfiguration")]
20 #[doc = "Change the `audio` field of this object."]
21 #[doc = ""]
22 #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`, `MediaDecodingConfiguration`*"]
23 #[wasm_bindgen(method, setter = "audio")]
24 pub fn set_audio(this: &MediaDecodingConfiguration, val: &AudioConfiguration);
25 #[cfg(feature = "VideoConfiguration")]
26 #[doc = "Get the `video` field of this object."]
27 #[doc = ""]
28 #[doc = "*This API requires the following crate features to be activated: `MediaDecodingConfiguration`, `VideoConfiguration`*"]
29 #[wasm_bindgen(method, getter = "video")]
30 pub fn get_video(this: &MediaDecodingConfiguration) -> Option<VideoConfiguration>;
31 #[cfg(feature = "VideoConfiguration")]
32 #[doc = "Change the `video` field of this object."]
33 #[doc = ""]
34 #[doc = "*This API requires the following crate features to be activated: `MediaDecodingConfiguration`, `VideoConfiguration`*"]
35 #[wasm_bindgen(method, setter = "video")]
36 pub fn set_video(this: &MediaDecodingConfiguration, val: &VideoConfiguration);
37 #[cfg(feature = "MediaDecodingType")]
38 #[doc = "Get the `type` field of this object."]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `MediaDecodingConfiguration`, `MediaDecodingType`*"]
41 #[wasm_bindgen(method, getter = "type")]
42 pub fn get_type(this: &MediaDecodingConfiguration) -> MediaDecodingType;
43 #[cfg(feature = "MediaDecodingType")]
44 #[doc = "Change the `type` field of this object."]
45 #[doc = ""]
46 #[doc = "*This API requires the following crate features to be activated: `MediaDecodingConfiguration`, `MediaDecodingType`*"]
47 #[wasm_bindgen(method, setter = "type")]
48 pub fn set_type(this: &MediaDecodingConfiguration, val: MediaDecodingType);
49}
50impl MediaDecodingConfiguration {
51 #[cfg(feature = "MediaDecodingType")]
52 #[doc = "Construct a new `MediaDecodingConfiguration`."]
53 #[doc = ""]
54 #[doc = "*This API requires the following crate features to be activated: `MediaDecodingConfiguration`, `MediaDecodingType`*"]
55 pub fn new(type_: MediaDecodingType) -> Self {
56 #[allow(unused_mut)]
57 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
58 ret.set_type(type_);
59 ret
60 }
61 #[cfg(feature = "AudioConfiguration")]
62 #[deprecated = "Use `set_audio()` instead."]
63 pub fn audio(&mut self, val: &AudioConfiguration) -> &mut Self {
64 self.set_audio(val);
65 self
66 }
67 #[cfg(feature = "VideoConfiguration")]
68 #[deprecated = "Use `set_video()` instead."]
69 pub fn video(&mut self, val: &VideoConfiguration) -> &mut Self {
70 self.set_video(val);
71 self
72 }
73 #[cfg(feature = "MediaDecodingType")]
74 #[deprecated = "Use `set_type()` instead."]
75 pub fn type_(&mut self, val: MediaDecodingType) -> &mut Self {
76 self.set_type(val);
77 self
78 }
79}