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