Skip to main content

web_sys/features/
gen_MediaRecorderOptions.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = MediaRecorderOptions)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `MediaRecorderOptions` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"]
12    pub type MediaRecorderOptions;
13    #[cfg(feature = "BitrateMode")]
14    #[doc = "Get the `audioBitrateMode` field of this object."]
15    #[doc = ""]
16    #[doc = "*This API requires the following crate features to be activated: `BitrateMode`, `MediaRecorderOptions`*"]
17    #[wasm_bindgen(method, getter = "audioBitrateMode")]
18    pub fn get_audio_bitrate_mode(this: &MediaRecorderOptions) -> Option<BitrateMode>;
19    #[cfg(feature = "BitrateMode")]
20    #[doc = "Change the `audioBitrateMode` field of this object."]
21    #[doc = ""]
22    #[doc = "*This API requires the following crate features to be activated: `BitrateMode`, `MediaRecorderOptions`*"]
23    #[wasm_bindgen(method, setter = "audioBitrateMode")]
24    pub fn set_audio_bitrate_mode(this: &MediaRecorderOptions, val: BitrateMode);
25    #[doc = "Get the `audioBitsPerSecond` field of this object."]
26    #[doc = ""]
27    #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"]
28    #[wasm_bindgen(method, getter = "audioBitsPerSecond")]
29    pub fn get_audio_bits_per_second(this: &MediaRecorderOptions) -> Option<u32>;
30    #[doc = "Change the `audioBitsPerSecond` field of this object."]
31    #[doc = ""]
32    #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"]
33    #[wasm_bindgen(method, setter = "audioBitsPerSecond")]
34    pub fn set_audio_bits_per_second(this: &MediaRecorderOptions, val: u32);
35    #[doc = "Get the `bitsPerSecond` field of this object."]
36    #[doc = ""]
37    #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"]
38    #[wasm_bindgen(method, getter = "bitsPerSecond")]
39    pub fn get_bits_per_second(this: &MediaRecorderOptions) -> Option<u32>;
40    #[doc = "Change the `bitsPerSecond` field of this object."]
41    #[doc = ""]
42    #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"]
43    #[wasm_bindgen(method, setter = "bitsPerSecond")]
44    pub fn set_bits_per_second(this: &MediaRecorderOptions, val: u32);
45    #[doc = "Get the `mimeType` field of this object."]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"]
48    #[wasm_bindgen(method, getter = "mimeType")]
49    pub fn get_mime_type(this: &MediaRecorderOptions) -> Option<::alloc::string::String>;
50    #[doc = "Change the `mimeType` field of this object."]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"]
53    #[wasm_bindgen(method, setter = "mimeType")]
54    pub fn set_mime_type(this: &MediaRecorderOptions, val: &str);
55    #[doc = "Get the `videoBitsPerSecond` field of this object."]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"]
58    #[wasm_bindgen(method, getter = "videoBitsPerSecond")]
59    pub fn get_video_bits_per_second(this: &MediaRecorderOptions) -> Option<u32>;
60    #[doc = "Change the `videoBitsPerSecond` field of this object."]
61    #[doc = ""]
62    #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"]
63    #[wasm_bindgen(method, setter = "videoBitsPerSecond")]
64    pub fn set_video_bits_per_second(this: &MediaRecorderOptions, val: u32);
65    #[doc = "Get the `videoKeyFrameIntervalCount` field of this object."]
66    #[doc = ""]
67    #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"]
68    #[wasm_bindgen(method, getter = "videoKeyFrameIntervalCount")]
69    pub fn get_video_key_frame_interval_count(this: &MediaRecorderOptions) -> Option<u32>;
70    #[doc = "Change the `videoKeyFrameIntervalCount` field of this object."]
71    #[doc = ""]
72    #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"]
73    #[wasm_bindgen(method, setter = "videoKeyFrameIntervalCount")]
74    pub fn set_video_key_frame_interval_count(this: &MediaRecorderOptions, val: u32);
75    #[doc = "Get the `videoKeyFrameIntervalDuration` field of this object."]
76    #[doc = ""]
77    #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"]
78    #[wasm_bindgen(method, getter = "videoKeyFrameIntervalDuration")]
79    pub fn get_video_key_frame_interval_duration(this: &MediaRecorderOptions) -> Option<f64>;
80    #[doc = "Change the `videoKeyFrameIntervalDuration` field of this object."]
81    #[doc = ""]
82    #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"]
83    #[wasm_bindgen(method, setter = "videoKeyFrameIntervalDuration")]
84    pub fn set_video_key_frame_interval_duration(this: &MediaRecorderOptions, val: f64);
85}
86impl MediaRecorderOptions {
87    #[doc = "Construct a new `MediaRecorderOptions`."]
88    #[doc = ""]
89    #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"]
90    pub fn new() -> Self {
91        #[allow(unused_mut)]
92        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
93        ret
94    }
95    #[cfg(feature = "BitrateMode")]
96    #[deprecated = "Use `set_audio_bitrate_mode()` instead."]
97    pub fn audio_bitrate_mode(&mut self, val: BitrateMode) -> &mut Self {
98        self.set_audio_bitrate_mode(val);
99        self
100    }
101    #[deprecated = "Use `set_audio_bits_per_second()` instead."]
102    pub fn audio_bits_per_second(&mut self, val: u32) -> &mut Self {
103        self.set_audio_bits_per_second(val);
104        self
105    }
106    #[deprecated = "Use `set_bits_per_second()` instead."]
107    pub fn bits_per_second(&mut self, val: u32) -> &mut Self {
108        self.set_bits_per_second(val);
109        self
110    }
111    #[deprecated = "Use `set_mime_type()` instead."]
112    pub fn mime_type(&mut self, val: &str) -> &mut Self {
113        self.set_mime_type(val);
114        self
115    }
116    #[deprecated = "Use `set_video_bits_per_second()` instead."]
117    pub fn video_bits_per_second(&mut self, val: u32) -> &mut Self {
118        self.set_video_bits_per_second(val);
119        self
120    }
121    #[deprecated = "Use `set_video_key_frame_interval_count()` instead."]
122    pub fn video_key_frame_interval_count(&mut self, val: u32) -> &mut Self {
123        self.set_video_key_frame_interval_count(val);
124        self
125    }
126    #[deprecated = "Use `set_video_key_frame_interval_duration()` instead."]
127    pub fn video_key_frame_interval_duration(&mut self, val: f64) -> &mut Self {
128        self.set_video_key_frame_interval_duration(val);
129        self
130    }
131}
132impl Default for MediaRecorderOptions {
133    fn default() -> Self {
134        Self::new()
135    }
136}