web_sys/features/
gen_MediaSession.rs

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