Skip to main content

web_sys/features/
gen_MediaRecorder.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = MediaRecorder , typescript_type = "MediaRecorder")]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `MediaRecorder` class."]
10    #[doc = ""]
11    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder)"]
12    #[doc = ""]
13    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"]
14    pub type MediaRecorder;
15    #[cfg(feature = "MediaStream")]
16    # [wasm_bindgen (structural , method , getter , js_class = "MediaRecorder" , js_name = stream)]
17    #[doc = "Getter for the `stream` field of this object."]
18    #[doc = ""]
19    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/stream)"]
20    #[doc = ""]
21    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`, `MediaStream`*"]
22    pub fn stream(this: &MediaRecorder) -> MediaStream;
23    #[cfg(feature = "RecordingState")]
24    # [wasm_bindgen (structural , method , getter , js_class = "MediaRecorder" , js_name = state)]
25    #[doc = "Getter for the `state` field of this object."]
26    #[doc = ""]
27    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/state)"]
28    #[doc = ""]
29    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`, `RecordingState`*"]
30    pub fn state(this: &MediaRecorder) -> RecordingState;
31    # [wasm_bindgen (structural , method , getter , js_class = "MediaRecorder" , js_name = mimeType)]
32    #[doc = "Getter for the `mimeType` field of this object."]
33    #[doc = ""]
34    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/mimeType)"]
35    #[doc = ""]
36    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"]
37    pub fn mime_type(this: &MediaRecorder) -> ::alloc::string::String;
38    # [wasm_bindgen (structural , method , getter , js_class = "MediaRecorder" , js_name = ondataavailable)]
39    #[doc = "Getter for the `ondataavailable` field of this object."]
40    #[doc = ""]
41    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/ondataavailable)"]
42    #[doc = ""]
43    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"]
44    pub fn ondataavailable(this: &MediaRecorder) -> Option<::js_sys::Function>;
45    # [wasm_bindgen (structural , method , setter , js_class = "MediaRecorder" , js_name = ondataavailable)]
46    #[doc = "Setter for the `ondataavailable` field of this object."]
47    #[doc = ""]
48    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/ondataavailable)"]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"]
51    pub fn set_ondataavailable(this: &MediaRecorder, value: Option<&::js_sys::Function>);
52    # [wasm_bindgen (structural , method , getter , js_class = "MediaRecorder" , js_name = onerror)]
53    #[doc = "Getter for the `onerror` field of this object."]
54    #[doc = ""]
55    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/onerror)"]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"]
58    pub fn onerror(this: &MediaRecorder) -> Option<::js_sys::Function>;
59    # [wasm_bindgen (structural , method , setter , js_class = "MediaRecorder" , js_name = onerror)]
60    #[doc = "Setter for the `onerror` field of this object."]
61    #[doc = ""]
62    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/onerror)"]
63    #[doc = ""]
64    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"]
65    pub fn set_onerror(this: &MediaRecorder, value: Option<&::js_sys::Function>);
66    # [wasm_bindgen (structural , method , getter , js_class = "MediaRecorder" , js_name = onpause)]
67    #[doc = "Getter for the `onpause` field of this object."]
68    #[doc = ""]
69    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/onpause)"]
70    #[doc = ""]
71    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"]
72    pub fn onpause(this: &MediaRecorder) -> Option<::js_sys::Function>;
73    # [wasm_bindgen (structural , method , setter , js_class = "MediaRecorder" , js_name = onpause)]
74    #[doc = "Setter for the `onpause` field of this object."]
75    #[doc = ""]
76    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/onpause)"]
77    #[doc = ""]
78    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"]
79    pub fn set_onpause(this: &MediaRecorder, value: Option<&::js_sys::Function>);
80    # [wasm_bindgen (structural , method , getter , js_class = "MediaRecorder" , js_name = onresume)]
81    #[doc = "Getter for the `onresume` field of this object."]
82    #[doc = ""]
83    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/onresume)"]
84    #[doc = ""]
85    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"]
86    pub fn onresume(this: &MediaRecorder) -> Option<::js_sys::Function>;
87    # [wasm_bindgen (structural , method , setter , js_class = "MediaRecorder" , js_name = onresume)]
88    #[doc = "Setter for the `onresume` field of this object."]
89    #[doc = ""]
90    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/onresume)"]
91    #[doc = ""]
92    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"]
93    pub fn set_onresume(this: &MediaRecorder, value: Option<&::js_sys::Function>);
94    # [wasm_bindgen (structural , method , getter , js_class = "MediaRecorder" , js_name = onstart)]
95    #[doc = "Getter for the `onstart` field of this object."]
96    #[doc = ""]
97    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/onstart)"]
98    #[doc = ""]
99    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"]
100    pub fn onstart(this: &MediaRecorder) -> Option<::js_sys::Function>;
101    # [wasm_bindgen (structural , method , setter , js_class = "MediaRecorder" , js_name = onstart)]
102    #[doc = "Setter for the `onstart` field of this object."]
103    #[doc = ""]
104    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/onstart)"]
105    #[doc = ""]
106    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"]
107    pub fn set_onstart(this: &MediaRecorder, value: Option<&::js_sys::Function>);
108    # [wasm_bindgen (structural , method , getter , js_class = "MediaRecorder" , js_name = onstop)]
109    #[doc = "Getter for the `onstop` field of this object."]
110    #[doc = ""]
111    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/onstop)"]
112    #[doc = ""]
113    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"]
114    pub fn onstop(this: &MediaRecorder) -> Option<::js_sys::Function>;
115    # [wasm_bindgen (structural , method , setter , js_class = "MediaRecorder" , js_name = onstop)]
116    #[doc = "Setter for the `onstop` field of this object."]
117    #[doc = ""]
118    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/onstop)"]
119    #[doc = ""]
120    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"]
121    pub fn set_onstop(this: &MediaRecorder, value: Option<&::js_sys::Function>);
122    # [wasm_bindgen (structural , method , getter , js_class = "MediaRecorder" , js_name = videoBitsPerSecond)]
123    #[doc = "Getter for the `videoBitsPerSecond` field of this object."]
124    #[doc = ""]
125    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/videoBitsPerSecond)"]
126    #[doc = ""]
127    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"]
128    pub fn video_bits_per_second(this: &MediaRecorder) -> u32;
129    # [wasm_bindgen (structural , method , getter , js_class = "MediaRecorder" , js_name = audioBitsPerSecond)]
130    #[doc = "Getter for the `audioBitsPerSecond` field of this object."]
131    #[doc = ""]
132    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/audioBitsPerSecond)"]
133    #[doc = ""]
134    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"]
135    pub fn audio_bits_per_second(this: &MediaRecorder) -> u32;
136    #[cfg(feature = "BitrateMode")]
137    # [wasm_bindgen (structural , method , getter , js_class = "MediaRecorder" , js_name = audioBitrateMode)]
138    #[doc = "Getter for the `audioBitrateMode` field of this object."]
139    #[doc = ""]
140    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/audioBitrateMode)"]
141    #[doc = ""]
142    #[doc = "*This API requires the following crate features to be activated: `BitrateMode`, `MediaRecorder`*"]
143    pub fn audio_bitrate_mode(this: &MediaRecorder) -> BitrateMode;
144    #[cfg(feature = "MediaStream")]
145    #[wasm_bindgen(catch, constructor, js_class = "MediaRecorder")]
146    #[doc = "The `new MediaRecorder(..)` constructor, creating a new instance of `MediaRecorder`."]
147    #[doc = ""]
148    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/MediaRecorder)"]
149    #[doc = ""]
150    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`, `MediaStream`*"]
151    pub fn new_with_media_stream(stream: &MediaStream) -> Result<MediaRecorder, JsValue>;
152    #[cfg(all(feature = "MediaRecorderOptions", feature = "MediaStream",))]
153    #[wasm_bindgen(catch, constructor, js_class = "MediaRecorder")]
154    #[doc = "The `new MediaRecorder(..)` constructor, creating a new instance of `MediaRecorder`."]
155    #[doc = ""]
156    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/MediaRecorder)"]
157    #[doc = ""]
158    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`, `MediaRecorderOptions`, `MediaStream`*"]
159    pub fn new_with_media_stream_and_media_recorder_options(
160        stream: &MediaStream,
161        options: &MediaRecorderOptions,
162    ) -> Result<MediaRecorder, JsValue>;
163    #[cfg(feature = "AudioNode")]
164    #[wasm_bindgen(catch, constructor, js_class = "MediaRecorder")]
165    #[doc = "The `new MediaRecorder(..)` constructor, creating a new instance of `MediaRecorder`."]
166    #[doc = ""]
167    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/MediaRecorder)"]
168    #[doc = ""]
169    #[doc = "*This API requires the following crate features to be activated: `AudioNode`, `MediaRecorder`*"]
170    pub fn new_with_audio_node(node: &AudioNode) -> Result<MediaRecorder, JsValue>;
171    #[cfg(feature = "AudioNode")]
172    #[wasm_bindgen(catch, constructor, js_class = "MediaRecorder")]
173    #[doc = "The `new MediaRecorder(..)` constructor, creating a new instance of `MediaRecorder`."]
174    #[doc = ""]
175    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/MediaRecorder)"]
176    #[doc = ""]
177    #[doc = "*This API requires the following crate features to be activated: `AudioNode`, `MediaRecorder`*"]
178    pub fn new_with_audio_node_and_u32(
179        node: &AudioNode,
180        output: u32,
181    ) -> Result<MediaRecorder, JsValue>;
182    #[cfg(all(feature = "AudioNode", feature = "MediaRecorderOptions",))]
183    #[wasm_bindgen(catch, constructor, js_class = "MediaRecorder")]
184    #[doc = "The `new MediaRecorder(..)` constructor, creating a new instance of `MediaRecorder`."]
185    #[doc = ""]
186    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/MediaRecorder)"]
187    #[doc = ""]
188    #[doc = "*This API requires the following crate features to be activated: `AudioNode`, `MediaRecorder`, `MediaRecorderOptions`*"]
189    pub fn new_with_audio_node_and_u32_and_options(
190        node: &AudioNode,
191        output: u32,
192        options: &MediaRecorderOptions,
193    ) -> Result<MediaRecorder, JsValue>;
194    # [wasm_bindgen (static_method_of = MediaRecorder , js_class = "MediaRecorder" , js_name = isTypeSupported)]
195    #[doc = "The `isTypeSupported()` method."]
196    #[doc = ""]
197    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/isTypeSupported_static)"]
198    #[doc = ""]
199    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"]
200    pub fn is_type_supported(type_: &str) -> bool;
201    # [wasm_bindgen (catch , method , structural , js_class = "MediaRecorder" , js_name = pause)]
202    #[doc = "The `pause()` method."]
203    #[doc = ""]
204    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/pause)"]
205    #[doc = ""]
206    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"]
207    pub fn pause(this: &MediaRecorder) -> Result<(), JsValue>;
208    # [wasm_bindgen (catch , method , structural , js_class = "MediaRecorder" , js_name = requestData)]
209    #[doc = "The `requestData()` method."]
210    #[doc = ""]
211    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/requestData)"]
212    #[doc = ""]
213    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"]
214    pub fn request_data(this: &MediaRecorder) -> Result<(), JsValue>;
215    # [wasm_bindgen (catch , method , structural , js_class = "MediaRecorder" , js_name = resume)]
216    #[doc = "The `resume()` method."]
217    #[doc = ""]
218    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/resume)"]
219    #[doc = ""]
220    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"]
221    pub fn resume(this: &MediaRecorder) -> Result<(), JsValue>;
222    # [wasm_bindgen (catch , method , structural , js_class = "MediaRecorder" , js_name = start)]
223    #[doc = "The `start()` method."]
224    #[doc = ""]
225    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/start)"]
226    #[doc = ""]
227    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"]
228    pub fn start(this: &MediaRecorder) -> Result<(), JsValue>;
229    # [wasm_bindgen (catch , method , structural , js_class = "MediaRecorder" , js_name = start)]
230    #[doc = "The `start()` method."]
231    #[doc = ""]
232    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/start)"]
233    #[doc = ""]
234    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"]
235    pub fn start_with_time_slice(this: &MediaRecorder, time_slice: i32) -> Result<(), JsValue>;
236    # [wasm_bindgen (catch , method , structural , js_class = "MediaRecorder" , js_name = stop)]
237    #[doc = "The `stop()` method."]
238    #[doc = ""]
239    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/stop)"]
240    #[doc = ""]
241    #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"]
242    pub fn stop(this: &MediaRecorder) -> Result<(), JsValue>;
243}