web_sys/features/
gen_MediaSession.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[cfg(web_sys_unstable_apis)]
6#[wasm_bindgen]
7extern "C" {
8 #[wasm_bindgen(
9 extends = "::js_sys::Object",
10 js_name = "MediaSession",
11 typescript_type = "MediaSession"
12 )]
13 #[derive(Debug, Clone, PartialEq, Eq)]
14 #[doc = "The `MediaSession` class."]
15 #[doc = ""]
16 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSession)"]
17 #[doc = ""]
18 #[doc = "*This API requires the following crate features to be activated: `MediaSession`*"]
19 #[doc = ""]
20 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
21 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
22 pub type MediaSession;
23 #[cfg(web_sys_unstable_apis)]
24 #[cfg(feature = "MediaMetadata")]
25 #[wasm_bindgen(method, getter, js_class = "MediaSession", js_name = "metadata")]
26 #[doc = "Getter for the `metadata` field of this object."]
27 #[doc = ""]
28 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/metadata)"]
29 #[doc = ""]
30 #[doc = "*This API requires the following crate features to be activated: `MediaMetadata`, `MediaSession`*"]
31 #[doc = ""]
32 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
33 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
34 pub fn metadata(this: &MediaSession) -> Option<MediaMetadata>;
35 #[cfg(web_sys_unstable_apis)]
36 #[cfg(feature = "MediaMetadata")]
37 #[wasm_bindgen(method, setter, js_class = "MediaSession", js_name = "metadata")]
38 #[doc = "Setter for the `metadata` field of this object."]
39 #[doc = ""]
40 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/metadata)"]
41 #[doc = ""]
42 #[doc = "*This API requires the following crate features to be activated: `MediaMetadata`, `MediaSession`*"]
43 #[doc = ""]
44 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
45 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
46 pub fn set_metadata(this: &MediaSession, value: Option<&MediaMetadata>);
47 #[cfg(web_sys_unstable_apis)]
48 #[cfg(feature = "MediaSessionPlaybackState")]
49 #[wasm_bindgen(method, getter, js_class = "MediaSession", js_name = "playbackState")]
50 #[doc = "Getter for the `playbackState` field of this object."]
51 #[doc = ""]
52 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/playbackState)"]
53 #[doc = ""]
54 #[doc = "*This API requires the following crate features to be activated: `MediaSession`, `MediaSessionPlaybackState`*"]
55 #[doc = ""]
56 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
57 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
58 pub fn playback_state(this: &MediaSession) -> MediaSessionPlaybackState;
59 #[cfg(web_sys_unstable_apis)]
60 #[cfg(feature = "MediaSessionPlaybackState")]
61 #[wasm_bindgen(method, setter, js_class = "MediaSession", js_name = "playbackState")]
62 #[doc = "Setter for the `playbackState` field of this object."]
63 #[doc = ""]
64 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/playbackState)"]
65 #[doc = ""]
66 #[doc = "*This API requires the following crate features to be activated: `MediaSession`, `MediaSessionPlaybackState`*"]
67 #[doc = ""]
68 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
69 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
70 pub fn set_playback_state(this: &MediaSession, value: MediaSessionPlaybackState);
71 #[cfg(web_sys_unstable_apis)]
72 #[cfg(all(feature = "MediaSessionAction", feature = "MediaSessionActionDetails",))]
73 #[wasm_bindgen(method, js_class = "MediaSession", js_name = "setActionHandler")]
74 #[doc = "The `setActionHandler()` method."]
75 #[doc = ""]
76 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/setActionHandler)"]
77 #[doc = ""]
78 #[doc = "*This API requires the following crate features to be activated: `MediaSession`, `MediaSessionAction`, `MediaSessionActionDetails`*"]
79 #[doc = ""]
80 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
81 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
82 pub fn set_action_handler(
83 this: &MediaSession,
84 action: MediaSessionAction,
85 handler: Option<&::js_sys::Function<fn(MediaSessionActionDetails) -> ::js_sys::Undefined>>,
86 );
87 #[cfg(web_sys_unstable_apis)]
88 #[wasm_bindgen(method, js_class = "MediaSession", js_name = "setCameraActive")]
89 #[doc = "The `setCameraActive()` method."]
90 #[doc = ""]
91 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/setCameraActive)"]
92 #[doc = ""]
93 #[doc = "*This API requires the following crate features to be activated: `MediaSession`*"]
94 #[doc = ""]
95 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
96 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
97 pub fn set_camera_active(this: &MediaSession, active: bool);
98 #[cfg(web_sys_unstable_apis)]
99 #[wasm_bindgen(method, js_class = "MediaSession", js_name = "setMicrophoneActive")]
100 #[doc = "The `setMicrophoneActive()` method."]
101 #[doc = ""]
102 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/setMicrophoneActive)"]
103 #[doc = ""]
104 #[doc = "*This API requires the following crate features to be activated: `MediaSession`*"]
105 #[doc = ""]
106 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
107 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
108 pub fn set_microphone_active(this: &MediaSession, active: bool);
109 #[cfg(web_sys_unstable_apis)]
110 #[wasm_bindgen(method, js_class = "MediaSession", js_name = "setPositionState")]
111 #[doc = "The `setPositionState()` method."]
112 #[doc = ""]
113 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/setPositionState)"]
114 #[doc = ""]
115 #[doc = "*This API requires the following crate features to be activated: `MediaSession`*"]
116 #[doc = ""]
117 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
118 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
119 pub fn set_position_state(this: &MediaSession);
120 #[cfg(web_sys_unstable_apis)]
121 #[cfg(feature = "MediaPositionState")]
122 #[wasm_bindgen(method, js_class = "MediaSession", js_name = "setPositionState")]
123 #[doc = "The `setPositionState()` method."]
124 #[doc = ""]
125 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/setPositionState)"]
126 #[doc = ""]
127 #[doc = "*This API requires the following crate features to be activated: `MediaPositionState`, `MediaSession`*"]
128 #[doc = ""]
129 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
130 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
131 pub fn set_position_state_with_state(this: &MediaSession, state: &MediaPositionState);
132}