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