web_sys/features/
gen_MediaElementAudioSourceOptions.rs

1#![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 = MediaElementAudioSourceOptions)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `MediaElementAudioSourceOptions` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `MediaElementAudioSourceOptions`*"]
12    pub type MediaElementAudioSourceOptions;
13    #[cfg(feature = "HtmlMediaElement")]
14    #[doc = "Get the `mediaElement` field of this object."]
15    #[doc = ""]
16    #[doc = "*This API requires the following crate features to be activated: `HtmlMediaElement`, `MediaElementAudioSourceOptions`*"]
17    #[wasm_bindgen(method, getter = "mediaElement")]
18    pub fn get_media_element(this: &MediaElementAudioSourceOptions) -> HtmlMediaElement;
19    #[cfg(feature = "HtmlMediaElement")]
20    #[doc = "Change the `mediaElement` field of this object."]
21    #[doc = ""]
22    #[doc = "*This API requires the following crate features to be activated: `HtmlMediaElement`, `MediaElementAudioSourceOptions`*"]
23    #[wasm_bindgen(method, setter = "mediaElement")]
24    pub fn set_media_element(this: &MediaElementAudioSourceOptions, val: &HtmlMediaElement);
25}
26impl MediaElementAudioSourceOptions {
27    #[cfg(feature = "HtmlMediaElement")]
28    #[doc = "Construct a new `MediaElementAudioSourceOptions`."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `HtmlMediaElement`, `MediaElementAudioSourceOptions`*"]
31    pub fn new(media_element: &HtmlMediaElement) -> Self {
32        #[allow(unused_mut)]
33        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
34        ret.set_media_element(media_element);
35        ret
36    }
37    #[cfg(feature = "HtmlMediaElement")]
38    #[deprecated = "Use `set_media_element()` instead."]
39    pub fn media_element(&mut self, val: &HtmlMediaElement) -> &mut Self {
40        self.set_media_element(val);
41        self
42    }
43}